Function (or VBA) to calculate just the above section?

DerekK

Board Regular
Joined
Jun 18, 2007
Messages
90
Office Version
  1. 2003 or older
Platform
  1. Windows
Good day, Excelsiors,

I have a sheet that has multiple "sections," and I need a formula which will calculate only the section above it. I have a formula that works but I have to continually update it over and over again and it gets time consuming. I'm sure there's a way to simplify it but I can't seem to figure out how.

Here is a simplified version of my sheet:

1 Section heading1
2 [blank]
3 [random number]
4 [random number]
5 =SUM(OFFSET($A$1,2,,(ROW()-ROW($A$1)-2)))
6 [blank]
7 Section heading1
8 [blank]
9 [random number]
10 [random number]
11 [random number]
12 =SUM(OFFSET($A$7,2,,(ROW()-ROW($A$7)-2)))

I've tried an array formula using ROW([something dynamic])*OFFSET()="Section heading1" but I can't seem to make the ROW element dynamic.

I know it seems silly but I have to repeat this over and over, and it's eating me inside!

Hope you can help!

Thanks,



Derek
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Sorry, this would make more sense if I explained that I don't know how many random numbers there will be and I continually have to adjust the number of random numbers summed, by moving the formula down.
 
Upvote 0

Forum statistics

Threads
1,215,176
Messages
6,123,470
Members
449,100
Latest member
sktz

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