Help on proper use of subtotals

Gringoire

Board Regular
Joined
Nov 18, 2016
Messages
71
Office Version
  1. 365
Platform
  1. Windows
Hello guys,

I'm preparing a template that will be distributed to several Users.
In one of the sheets there is a long sum splitted in "groups". Each group has a description row and a subtotal.

Let's say that this is a group:
- K7 is the description
- K8 ... K15 are free for introducing data.
- K16 is the subtotal. The formula in cell K16 is simply
Excel Formula:
=SUBTOTAL(9,K7:K15)

The User is (must be) allowed to insert extra rows in the group if necessary, and this works perfectly until the User select the subtotal row (K16) to insert a new row immediately before it.
In this case (and only in this case) the data belonging to this new row are NOT included in the subtotal, and this causes errors.

How could I modify the above mentioned formula in order to avoid this unwanted behavior?
For several reasons I prefer to avoid the use of VBA.

thank you.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi Gringoire,

What I do in such situations is to add an extra row just before the sub-total formula and keep it with a height of 5 and this automatically cautions the user to add any row only above that and the formula will dynamically keep on changing. So instead of subtotal formula in K16, I will put the formula
Excel Formula:
=SUBTOTAL(9,K7:K16)
in cell K17
 
Upvote 2
Solution
Yes, it is a nice idea!
I can also protect the extra row from writing, preventing the User to input data in that row.

thanks.
 
Upvote 0

Forum statistics

Threads
1,215,203
Messages
6,123,627
Members
449,109
Latest member
Sebas8956

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