gkeenley
gkeenley

Reputation: 7388

How do you update range of formula in Google Sheets when you add a row?

I have a column in a Google sheet that has numbers in cells A1-A5. In A7 I show the sum of cells A1-A5 using =SUM(A1:A5). I want to be able to add/remove cells from the A1-A5 range and have A7 behave accordingly.

For example, I want to add a number in A6 by clicking "insert row below" on row 5, and have the sum in A7 move down to A8 and have its formula update to =SUM(A1:A6).

So here's what I have right now:

enter image description here

...and here's the kind of thing I want to be able to add:

enter image description here

Upvotes: 2

Views: 2278

Answers (1)

player0
player0

Reputation: 1

instead of your =SUM(A1:A5) use this:

=SUM(INDIRECT("A1:A"&ROW()-1))

this will allow you to get sum of all above regardless if you add or delete rows

Upvotes: 8

Related Questions