Spreadsheet: 830015d1684639946-single-let-function-to-get-sub-total-at-each-stage-sub-total
Sheet: Destination-Correct

 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Allocation of Quantity month & below (excelforum.com) |  |  |  |  |  |  |  |  |  | < Helper Columns >
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Expected Answer |  |  |  |  |  | Extracted columns from Source Sheet |  |  |  |  |  | Month-1 | Month-1 | Month-2 | Month-2 | Month-3 | Month-3
 | Item |  |  |  |  |  |  |  |  |  |  | Month |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Quantity | Total |  |  |  |  |  | Item | Month | SN | Quantity | Total | Price | Quantity | Total | Quantity | Total | Quantity | Total
 | Product A |  |  |  |  |  |  |  |  |  |  | 1 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 50 |  |  |  |  |  |  |  | 0 | 0 | 0 | 0 | 0
 | Product B |  |  |  |  |  |  |  |  |  |  | 1 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 213 |  |  |  |  |  |  | Total | 0 | 0 | 0 | 0 | 0
 | Product A |  |  |  |  |  |  |  |  |  |  | 2 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 142 |  | < Correct result |  |  |  |  | Product A | 0 | 1 | 10 | 25 | 2.5 |  |  | 5
 | Product B |  |  |  |  |  |  |  |  |  |  | 2 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 210 |  | < Correct result |  |  |  |  | Product A | 1 | 3 | 10 | 25 | 2.5 |  |  | 10
 | Product B |  |  |  |  |  |  |  |  |  |  | 3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 55 |  | < Correct result |  |  |  |  | Product A | 1 | 5 | 15 | 60 | 4 |  |  | 15
 | Product A |  |  |  |  |  |  |  |  |  |  | 3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 10 |  | < Correct result |  |  |  |  | Product A | 1 | 7 | 17 | 70 | 4.12 |  |  | 17
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product A | 2 | 9 | 20 | 66 | 3.3 |  |  | 20
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product A | 2 | 11 | 75 | 120 | 1.6 |  |  | 75
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product A | 3 | 12 | 20 | 195 | 9.75 |  |  |  |  | 10
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product A Total | 10 | 48 | 167 | 561 | 27.77
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product B | 0 | 2 | 45 | 540 | 12
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product B | 1 | 4 | 80 | 120 | 1.5 |  |  | 70
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product B | 1 | 6 | 95 | 155 | 1.63 |  |  | 95 |  | 10
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product B | 2 | 10 | 45 | 197 | 4.38 |  |  | 45 |  | 45
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Product B Total | 4 | 22 | 265 | 1012 | 19.51