Saving calculation time on large workbook

thenextguy

Board Regular
Joined
Sep 19, 2004
Messages
72
I have a list of items and costs that is sliced and diced in numerous ways using sumproduct functions.

The list is updated each year and I'd prefer not to update my formulas each year, so I've tried to make the formulas dynamic. I'm using a COUNTA (example: =COUNTA(Sheet1!B1:B65536)) formula to keep track of the number of entries on the list and then using OFFSET formulas to adjust my ranges based on this numbers.

Okay, that's the setup. This question is this:

Is there an advantage of having only one COUNTA formula and then having my OFFSET formulas reference this cell. Example:

Code:
=SUM(OFFSET(Sheet1!A1,0,0,B1))
where A1 contains the aforementioned COUNTA formula.

Or should I just go ahead and build the COUNTA formula into OFFSET formula. Example:

Code:
=SUM(OFFSET(COUNTA(Sheet1!B1:B65536),0,0,B1))

I hope this makes sense. I'll be happy to try again if anything is unclear. Also, if there is a better way to do what I'm currently trying to do, I'm all for that, too! :)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
offset() is volatile - lot's of them would impact workbook performance. replace with index() equivalent
 
Upvote 0
offset() is volatile - lot's of them would impact workbook performance. replace with index() equivalent

Thanks for the reply, PaddyD. Can you explain a little further? I've only used index() to refer to one item in a range. How can I use it to resize a range?
 
Upvote 0
as per the excel help file entry, index() can return a reference as well as a value.

if a1:a5 is populated by, e.g. row(), then

=sum(a1:index(a:a, count(a:a)))

would return 15 - or, if you had the count in b1:

=sum(a1:index(a:a, b1))
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

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