Creating dynamic Sum range if total is at the top of range

bearcub

Well-known Member
Joined
May 18, 2005
Messages
732
Office Version
  1. 365
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
Years ago I learned of an excel hack where you could replace the last range reference in a range with a cell refence using the name manager. The sum formula would have to be below the table like this:

1730748738086.png


The formula, as you can see is in AG 75. I replace the AG 74 will the RA which references the row above the $710,248.89.

Within the help of the name manager and RA range, if I wanted to include new values after row 73 I would need to manually change the cell range from AG 73 to AG74.

Is there a way to create an expanding range for formulas that would be added to the top of table. Meaning, if I inserted a row at the top of the table so the formula was in AG1, the RA formula would not work because I would not be referencing the cell before the formula. I looked at using the Index formula as the second range parameter but that includes a fixed range so it would not excpand.

Could I use the CountA function to replace the cell reference: Sum(Ag2: AG73) to Sum (Ag2: Counta(Ag2:Ag1000))
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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