Nov 27 2020 06:19 AM
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.
Nov 27 2020 06:33 AM
@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?
Nov 27 2020 06:57 AM
@Riny_van_Eekelen Here is the sheet that I am having problems with.
Nov 27 2020 07:29 AM
@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.
Nov 27 2020 07:56 AM - edited Nov 27 2020 07:57 AM
@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.
Nov 27 2020 08:24 AM
@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:
=SUM(E47:OFFSET(E50,-1,0))
You'll need to do this for each of your sub-totals. Let me know if it works, or not.
Nov 27 2020 09:11 AM
@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))
Nov 27 2020 09:13 AM
@gloriaBRC802 Sorry. Don't understand. Did you try the formula in my previous post?
Nov 27 2020 09:32 AM
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
Nov 27 2020 09:37 AM
@gloriaBRC802 Really sorry, but don't understand what you mean.
Nov 27 2020 09:43 AM
@Riny_van_Eekelen I see what I did wrong. Thank you for your help.