Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARRAYFORMULA to sum previous row cell

I have a data sheet like this.

Column--    |C1|C2|C3|Total|
=========================
Row--1      | 0| 0| 0|  100| (I will have some pre calculated value for total column which is not sum of the columns in this row)

Row--2      |10|20|30|  160| (sum of previous row =100+current row (10+20+30) = 160)

Row--3      | 1| 2| 3|  166|

Row--4      | 4| 5| 6|  181|

Today I am using a copy paste formula for each row. However, I want an array formula for SUM column so that the formula will automatically work when I add new rows.

What I want is, SUM column will contain sum of current row A through D values and previous row SUM value.

So in a google spread sheet I'll initially have 20 rows only. Based on the transactions I'll add rows and so I want an array formula so that my formula will work even after adding new rows.

Added an example sheet

https://docs.google.com/spreadsheets/d/1wlWqdFwgv90s50iP-bXXBHciyualohj610qFiSatcmQ/edit?usp=sharing

like image 459
Venu Avatar asked Jun 18 '26 08:06

Venu


1 Answers

Another method for an array cumulative sum:

=ArrayFormula(SUMIF(IF(COLUMN(A1:D1),ROW(A2:A)),"<="&ROW(A2:A),A2:D))

like image 155
AdamL Avatar answered Jun 21 '26 00:06

AdamL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!