Search code examples
google-sheetsgoogle-sheets-formula

How to create multiple running totals in one column using SCAN


My question is about using the scan formula.

I only want to use a formula in C2 and i would like to create a running total for category (column A) A and B. Bonuspoints for the formula works for a undefined amount of categories :)

How can i do this?

link to sheet

enter image description here


Solution

  • Here's one approach you may test out:

    =map(A2:A,B2:B,lambda(Σ,Λ,if(Σ="",,sumif(A2:Σ,Σ,B2:Λ))))
    

    enter image description here