I want to sum the columns of a row and display the sum in the last column. As shown in the example below sum of each row is displayed in column TOTAL

            COL1    COL2    COL3    COL4    TOTAL
    ROW1     4       6       2        1      13
    ROW2     2       2                2       6

In the future, more columns may be added. So I want a formula for column TOTAL that can find the sum of range COL1 to TOTAL-1.

migrated from superuser.com Jun 24 '17 at 9:54

This question came from our site for computer enthusiasts and power users.


You can do sum(range) you can pass it a range in R1C1 format. So you can build that string from the getcolumn of the total column and the startcolumn, alternatively you can use a named range.

You might also do something like find in the header row and search for total there to find the column index, but I don't remember how to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy