Dear Sir, thank you for your answer, I tried the formula but it is still not working. I am uploading the QV file I am working on, please observe the last two columns, they should show the same values. The first one is with the formula you proposed, the second one collects the data from the excell file, where I calculated the final value. Please collaps the rows in the pivot table, and the value becomes zero.
The project is about calculating the catering costs based on a unit price and the presence of the kids in the 5 working days of a week.