1

I have a row with several months of values (C43:F43) that I want to sum on the farthest left column (B43).

enter image description here

When I add a new month in Col "C", I want the sum formula to dynamically include that new month in C43, but it moves over to start in Col D43.

enter image description here

I tried INDIRECT and it works to include the new column, but, if I insert a row above row 43, it messes up the formulas.

I then tried the OFFSET formula, but to no avail.

Any insight would be greatly appreciated. I now realize EXCEL is quite advanced.

Thank you.

1

2 Answers 2

1

Easy way: create a column to the right of your total, make it as narrow as possible (or hide it), and do your sum from this column (which will be column C) to the end of your data set. When you add a column (which will always be column D), your SUM will always cover it.

More complicated formula: you can use =SUM(OFFSET(B43,0,1,1,1000))

The offset formula can reference the cell you're in as long as you shift away from it. In the example above, I'm moving zero rows, one column to the right, in a range with height 1 cell and width 1000 cells. You can also if you have to end at column G use

=SUM(OFFSET(B43,0,1,COLUMN(G43)-2)

The G43 will move as you add columns so your formulae will stay in sync

3
  • Worked like a charm, even when adding, subtracting rows/columns. And outstanding explanation of OFFSET, which is what I used-- much better than what I found on via Google search. Thank you. Commented Dec 14, 2016 at 22:37
  • What does the "-2" after (G43) do, btw? Commented Dec 14, 2016 at 22:39
  • 1
    thanks for the response! the -2 is there as you're starting from column B - COLUMN(G43) returns 7 - but we only need the offset to be 5 columns wide. A more complete way of writing the formula would be =SUM(OFFSET(B43,0,1,COLUMN(G43)-COLUMN(B43))
    – Jon
    Commented Dec 14, 2016 at 23:48
0

To fix the column, put a $ sign before the column letter. To fix the row, put a $ sign before the line number

=SUM($C$43:F$43)
3
  • That method doesn't work. When I add those $ signs and insert a column to the left of Col C, it automatically moved sum($c$43... to sum($d$43.... Commented Dec 14, 2016 at 22:16
  • Arf, what version are you using ?
    – Simon
    Commented Dec 14, 2016 at 22:19
  • Excel for Mac 2011 Commented Dec 14, 2016 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.