Keeping SUM range when adding a new row to the 1st place

sduttonusa

New Member
Joined
Jan 13, 2016
Messages
43
I have numbers across rows 10 to 25. Underneath (say row 45), I get the SUM of the columns above =SUM(A10:A25), =SUM(B10:B25), etc. When I add a new row somewhere in the middle of the rows, the bottom of the column SUM takes into account the new row =SUM(A10:A26), =SUM(B10:26), etc.

But if I add a new row in the 1st place position, row 10, the SUM below becomes =SUM(A11:A26), =SUM(B11:B26) . . . row 10 doesn't get included. This even happens if I create a new row in the middle, and then later move it up to the 1st position.

Is there a way around this?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Convert the range to a Table. Highlight all of your data then on the excel ribbon, click Insert > Table. You can then add a "Total Row" through the Design ribbon which can be used to sum all data in specific columns/rows. That way when you add data, it will automatically update.

You could also just use the =Sum() formula and select the header under which data you want to sum.
 
Upvote 0
I have numbers across rows 10 to 25. Underneath (say row 45), I get the SUM of the columns above =SUM(A10:A25), =SUM(B10:B25), etc. When I add a new row somewhere in the middle of the rows, the bottom of the column SUM takes into account the new row =SUM(A10:A26), =SUM(B10:26), etc.

But if I add a new row in the 1st place position, row 10, the SUM below becomes =SUM(A11:A26), =SUM(B11:B26) . . . row 10 doesn't get included. This even happens if I create a new row in the middle, and then later move it up to the 1st position.

Is there a way around this?

Maybe the formula below can helps:

=SUM(INDEX(A:A,10):A27)

Markmzz
 
Upvote 0
Thank you for your quick replies, Robby19 and markmzz. I would like to try to solve this issue using one of the formulas that you suggested. (Converting my data to a table messed up my column widths, colors, heading titles, etc.). I've posted a small table below so I can better understand the designations within the formulas you suggest. Robby19, I wasn't able to figure out how to SUM a selected Header. markmzz, the SUM(INDEX*** formula worked fine, but I quickly discovered that if I add a new row at the bottom of the table, I have the same problem: the last row is ignored. Is there a tweak to the SUM(INDEX*** formula that I can add?


A4 REIMBURSEMENTS B4 JAN C4 FEB D4 MAR
A5 Shaum100100100
A6 Tagargulias200300400
A7 Thompson300200200
A8 Vorm200100200
A9 TOTAL800700900

<tbody>
</tbody>

Row 4 is my Header Row. A5 is where a new first row will be placed, and after A8 is where a new row at the bottom would be placed. I may find myself being forced to use a table because this isn't the only set of numbers on the worksheet. There will be new rows created above this particular set of number (but perhaps your formulas will automatically make accommodations for the movement of this set of numbers up and down the page.
 
Last edited:
Upvote 0
Thank you for your quick replies, Robby19 and markmzz. I would like to try to solve this issue using one of the formulas that you suggested. (Converting my data to a table messed up my column widths, colors, heading titles, etc.). I've posted a small table below so I can better understand the designations within the formulas you suggest. Robby19, I wasn't able to figure out how to SUM a selected Header. markmzz, the SUM(INDEX*** formula worked fine, but I quickly discovered that if I add a new row at the bottom of the table, I have the same problem: the last row is ignored. Is there a tweak to the SUM(INDEX*** formula that I can add?

A4 REIMBURSEMENTS B4 JAN C4 FEB D4 MAR
A5 Shaum100100100
A6 Tagargulias200300400
A7 Thompson300200200
A8 Vorm200100200
A9 TOTAL800700900

<tbody>
</tbody>
Row 4 is my Header Row. A5 is where a new first row will be placed, and after A8 is where a new row at the bottom would be placed. I may find myself being forced to use a table because this isn't the only set of numbers on the worksheet. There will be new rows created above this particular set of number (but perhaps your formulas will automatically make accommodations for the movement of this set of numbers up and down the page.

Hi!

Try this in A9 and copy to the right:

=SUM(INDEX(B:B,5):OFFSET(B9,-1,))


ABCDE
3
4REIMBURSEMENTSJANFEVMAR
5Shaum100100100
6Tagargulias200300400
7Thompson300200200
8Vorm200100200
9TOTAL800700900
10
*************************************

<tbody>
</tbody>


Markmzz
 
Upvote 0
If it's not too much of a problem, so I truly understand what is happening in the formula, could you take a moment and break the formula down to explain it? What does the INDEX formula do? The first instance of "B", after INDEX, that refers to the column, correct? Why the semi-colon before B,5 (and why the comma). The second semi-colon is there to give the range for the SUM to be calculated, correct? What does the OFFSET do?
 
Upvote 0
Hi!

Try this in B9 and copy to the right:

=SUM(INDEX(B:B,5):OFFSET(B9,-1,))

Markmzz

You meant, "Try this in B9, correct?" When I put it in B9, it works.

Yes, you are right. Look the text above (in red).

If it's not too much of a problem, so I truly understand what is happening in the formula, could you take a moment and break the formula down to explain it? What does the INDEX formula do? The first instance of "B", after INDEX, that refers to the column, correct? Why the semi-colon before B,5 (and why the comma). The second semi-colon is there to give the range for the SUM to be calculated, correct? What does the OFFSET do?

Lets go:

1) In the part INDEX(B:B,5) - the B:B refers to all column B, the 5 refers to the fifth row of the column B (so the result is B5 - the start (first) part of the final range of the argument of the SUM function).

2) The second semi-colon is to link the start (first) part of the range (B5) with the end part of the range (the result of the OFFSET function).

3) The OFFSET function (look at the link below for more details - OFFSET(B9,-1,)) offset for cell B9 one cell above (-1 - then we have B8).

https://support.office.com/en-us/article/offset-function-c8de19ae-dd79-4b9b-a14e-b4d906d11b66

4) So, the final result of the argument of SUM function is B5:B8.

I hope that this helps.

Markmzz
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top