ANKUSHRS1
... part of my a vba program
Okay, a basic idea:
1) Check the last rows A-column value
2) Solve needed Total sums of prev value eg with SumIfs ...
3) Add text 'Total' to below of the last row and add those sums
4) step as many rows up until A-column value will change
5) make a new row
6) repeat steps from 2 to 4 as many times as needed (notice which A-column value will be the last value)