Search code examples
google-sheetsarray-formulas

Arrayformula with different rows? (running total)


I am trying to do simple formula =AS2+AP3 in cell AS3 for the entire row AS. So in cell AS4 it would be =AS3+AP4. I can do it simply with copy and paste. But it doesn't work with arrayformula. Is there a way around it?


Solution

  • I think you want a running total of the numbers in column AP, but starting with whatever number is in AS2. You can do this sort of thing with a SUMIF which adds up all the numbers up to the current row:

    =ArrayFormula(if(AP3:AP="","",sumif(row(AP3:AP),"<="&row(AP3:AP),AP3:AP)+AS2))
    

    enter image description here