Google Sheets – Select Range of Cells Relative to Current Cell

google sheets

I am trying to calculate the sum of a range of cells relative to the current cell. This is what I have, and it works:

=SUM(INDIRECT(ADDRESS(ROW()-6,COLUMN()-1)), INDIRECT(ADDRESS(ROW()-5,COLUMN()-1)), INDIRECT(ADDRESS(ROW()-4,COLUMN()-1)), INDIRECT(ADDRESS(ROW()-3,COLUMN()-1)), INDIRECT(ADDRESS(ROW()-2,COLUMN()-1)), INDIRECT(ADDRESS(ROW()-1,COLUMN()-1)), INDIRECT(ADDRESS(ROW(),COLUMN()-1)))

So the sum of the last 7 rows (including current one), column to the left. Is there an easier way to do this?

Best Answer

This is as simple as I could get using INDIRECT (RC notation):

=SUM(INDIRECT("R"&ROW()-6&"C"&COLUMN()-1&":R"&ROW()&"C"&COLUMN()-1,))

However using OFFSET is much shorter (B7 being the cell the formula is in)

=sum(offset(B7,-6,-1,7,1))

Just because I put B7 in the above formula doesn't mean it is not relative, it is, if you copy and paste it into any cell it will "relatively" work but if you insist on not having any cell reference then combining the two methods would produce the cleanest way:

=sum(offset(indirect(address(row(),column())),-6,-1,7,1))