Sum a fixed range

Bagsy

Active Member
Joined
Feb 26, 2005
Messages
467
Office Version
  1. 365
Platform
  1. Windows
Hopefully somebody can help me out a bit here.
I have a range I need to sum =SUM(F5:F3000)
But I need to allow the users to be able to delete rows within this range once they are completed, this then has the effect of changing the formula even if it absolute =SUM(F$5:F$3000)
How do I fix this formula so that the range is always (F5:F3000) even if rows within this range are deleted.
I cannot use VBA in this case to re-enter the formula, as this needs to be emailed and cannot have any macros.
Thanks in advance
Gary
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
That’s is brilliant thanks Alan
Would you mind explaining what the formula is doing and how it works please
 
Upvote 0
the formula rely on the offset() function to define the array to sum up.

the offset() in the formula basically say set up an array from Cell $F$1, start from 4 rows down and 0 column across (i.e. $F$5), with 2996 cells (i.e. to $F$3000).
 
Upvote 0
Appologies Alan
What is the 1 for after the 2996 =SUM(OFFSET($F$1,4,0,2996,1))
I have tried changing it to see what would happen and it diddn't seem to make any difference unless I change it to 0 then it gives me an error
 
Upvote 0
How do I fix this formula so that the range is always (F5:F3000) even if rows within this range are deleted.

Hi, here is another option that avoids the volatile OFFSET() or INDIRECT() functions.

=SUM(INDEX(F:F,5):INDEX(F:F,3000))
 
Last edited:
Upvote 0
Appologies Alan
What is the 1 for after the 2996 =SUM(OFFSET($F$1,4,0,2996,1))
I have tried changing it to see what would happen and it diddn't seem to make any difference unless I change it to 0 then it gives me an error

1 is the width of the array, as your data is in single column thus 1.
if you have data in the corresponding column G, and change the 1 to 2 then you can see the difference


Book1
ABCD
11615
22755
338
449
5510
Sheet1
Cell Formulas
RangeFormula
D1=SUM(OFFSET($A$1,0,0,5,1))
D2=SUM(OFFSET($A$1,0,0,5,2))
 
Upvote 0
you can always check the syntax of the formula by click on the formula bar like this

<img src="https://www.pixelsbin.com/images/2019/06/20/Untitled4fa2a03ff8dd5b0d.jpg" alt="Untitled4fa2a03ff8dd5b0d.jpg" border="0">
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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