The attached is a bit of a cheat, and may not be robust enough for you.
There's a button in the vicinity of cell P6 of the sheet REPORT (2), which is how I imagine your sheet starts out as (without totals).
Press the button, only once mind, and see if it gives the results you want.
There are other ways…
p45cal Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.