Search code examples
google-sheetsgoogle-sheets-formula

Dynamically sum cells on current row starting at a specific column, and ending on the column before current cell


How would you add all the numbers in the current row(dynamic address) starting at specific column and leading up to the column one left of current cell? I want the row and column references dynamic to handle insertions and removals of columns and rows

Basic spreadsheet to demonstrate https://docs.google.com/spreadsheets/d/15MzHnGnW1uR0Pvb_npEJKZOELu_PYPz0L6eb3Zh9LRA/edit#gid=0

Is this correct, if I am adding starting on column 3

=SUM(INDIRECT(ADDRESS(ROW(),3,4) &":"&ADDRESS(ROW(),COLUMN()-1,4)


Solution

  • =SUM(INDIRECT(ADDRESS(ROW(),3,4) &":"&ADDRESS(ROW(),COLUMN()-1,4)
    

    seems to solve my problem, though it seems a bit unwieldy.