Reputation: 2845
How can I let each cell in the B column be the sum of the previous 3 cells in the A column? I could write the formula =SUM(A1:A3)
in cell B3 and "pull it down", but I want to solve this with a single formula in B3 (or B1).
A B
1 1
2 1
3 2 4
4 3 6
5 5 10
6 8 16
Upvotes: 0
Views: 215
Reputation: 50472
You can use SUMIF like this:
B3:
=ARRAYFORMULA(SUMIF(ROW(A1:A20),"<="&ROW(A3:A20),A1:A20))
Upvotes: 1