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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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,213,553
Messages
6,114,279
Members
448,562
Latest member
Flashbond

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