I'm looking for a simple way to sum a range of values from specific rows within a google sheets table.
For example, if I have a table with dates and numbers with a table name of "Day of the Year" and I want to sum the values from the entire Numbers column then I would just use "=SUM(Day_of_the_Year[Number])"; however, is there a simple way to sum just the middle two values or the last three through some sort of indexing? I can't seem to find anything obvious other than using the query function which I'd rather avoid.
Date | Numbers |
---|---|
01/01/25 | 1 |
02/01/25 | 2 |
03/01/25 | 3 |
04/01/25 | 4 |
Also:
=sum(index(Table1[Numbers],2):index(Table1[Numbers],3))
for middle 2 and
=sum(index(Table1[Numbers],2):index(Table1[Numbers],4))
for last three.
This method is maybe slightly more convenient if the numbers to be added are in consecutive cells, otherwise chooserows works better. In this particular case, Sum does allow multiple ranges, so to add the first and fourth values you could put
sum(index(Table1[Numbers],1),index(Table1[Numbers],4))