Sum Indirect not working

Occasional Contributor

I have a spreadsheet that is divided into several sections and I need each section to be totaled separately. I am using =SUM(INDIRECT("E$22:E"&ROW()-1)) to have to rows automatically include any new rows that I add the problem I am having is when I do add a new row it changes the starting column number and throws off my calculation. So how do I get this to work or is there another way that I can get the results that I am looking for. I don't want to have to manually update the sum formula every time I add a new row.

11 Replies

@gloriaBRC802 Tested your formula. Should work. Either by inserting a row above the cell with the formula or by moving the formula down and inserting new values above it. Works all the time. Can you upload your schedule (delete confidential information) to demonstrate the problem?

@Riny_van_Eekelen  Here is the sheet that I am having problems with. 

@gloriaBRC802 Can't see anything wrong with it. The sub-totals in E seem to work OK. Can insert a row, enter an amount and the sub-total updates correctly. But perhaps that is not what mean.

@Riny_van_Eekelen  when I added a new line in the section labeled Administrative the total in line E51 changes to include line E47 and it continues to do that so the total cost at the very bottom is wrong. It should not start including the subtotal from the section above.

@gloriaBRC802 Okay! That's because you "hard-code" the first cell of the range called by INDIRECT.


Using your example for the sub-total in E50, try it this way:


You'll need to do this for each of your sub-totals. Let me know if it works, or not.

@Riny_van_Eekelen with this formula to include multiple rows can I just enter the range and it still work properly. Example: =SUM(E44:E59:OFFSET(E60,-1,0))

@gloriaBRC802 Sorry. Don't understand. Did you try the formula in my previous post?

yes, I did but it doesn't add up all the lines in the separate sections. It works but only for a few of the lines

@gloriaBRC802 Really sorry, but don't understand what you mean.

@Riny_van_Eekelen  I see what I did wrong. Thank you for your help.

@gloriaBRC802 Glad you resolved it!