Extending a SUM range, based upon a cell value

tommyarra

New Member
Joined
May 11, 2024
Messages
3
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi guys,

New here.. and relatively new to excel. So I apologise if this is an easy one that I should have figured out.

Essentially what I want to do is increase a cell range in a SUM formula, based upon a different cell value. Specifically including another row, directly above.

For example, my current formula is

=SUM(C2:E12)/1955

I would like it to extend by 1 row above, if cell E13 value is 1

So if a 1 was entered into cell E13, the calculation would be automatically adjusted to (B2:E12)/1955

And if a 2 was entered it would be (A2:E12)/1955


Not sure if this is possible...? Thanks so much, in advance
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
try this:
Book1
ABCDE
1
21381658
3129111622
418178189
58481217
614881116
71418182514
812914189
913812135
101717131217
118472123
1268232416
132
14Formula:714
Sheet2
Cell Formulas
RangeFormula
B14B14=SUM(INDEX(A2:E12,1,SWITCH(E13,1,2,2,1,3)):E12)
 
Upvote 0
I'm such a donut and I have just realised that I totally messed up my original post 🤦‍♂️🤣 getting rows and columns mixed up, just about sums up my skill level!!

Let's try again... Thanks so much for your help.

Current formula in cell H62 : =SUM(B10:E61)/1955

I'd like it to look at cell K62 and if it is 1, add 1 row ABOVE...

So, change the B6 part of the formula to B9...

And if a 2 was added it would change to B8...

And if a 3 was added it would change to B7 etc etc etc
 
Upvote 0
Try:
Excel Formula:
=SUM(DROP(B1:E61,9-K62))/1955
 
Upvote 0
Try:
Excel Formula:
=SUM(DROP(B1:E61,9-K62))/1955

👏 Legend.. this appears to work (I'm very tired at the end of a night shift, so I'll test it thoroughly tomorrow)

Am I write in saying, if I wanted the same formula in the cell above, it would be

=SUM(DROP(B1:E60,8-K61)/1955

???

So, I want the B1 to always be B1

E60 to move up a row,
9 changes to 8
And the lookup cell moves up a row to K61

If this is correct. How do I easily copy the formula to multiple rows?

Thanks so so much. This is going to help me massively.
 
Upvote 0
Try this in H62 and copy up.
Excel Formula:
=SUM(DROP(B$1:E61,ROW(B62)-53-K62))/1955

Note the last row you can copy up is row 54 because anything beyond this is above row 1 which doesn't exist.
 
Upvote 0

Forum statistics

Threads
1,216,901
Messages
6,133,361
Members
449,803
Latest member
ogalbnafets

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