Performance question regarding named range

YounesB3

Board Regular
Joined
Mar 28, 2012
Messages
148
Hello, what is less heavy between :

A) =INDIRECT("Sheet1!$A$1:$Q$"&counta(Sheet1!$A:$A))

B) =Sheet1!$A$1:$Q$20000

when you reference to this named range?

Does it depends on the amount of formulas referencing to the above, or is one strictly always better then the other?
 
Last edited:

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.
hello

The INDIRECT formula has a calculation overhead. If you've only one such formula, it isn't much of an impact: if you have lots, it can be. (If relevant, such a dynamic named range is not recognised when doing queries - such as databases use, with SQL, etc.)

The other definition is lean & mean. Though excessive if using 20000 just to cover an 'always big enough' range that is far more than you really need.

Another approach if the second formula need only cover the rows you actually have, is to use VBA to update the defined name. Such as where a data range is on a worksheet, use
Code:
Private Sub Worksheet_Deactivate()
me.range("A1").CurrentRegion.Name = "YourDataRangeName"
End Sub
 
Upvote 0
hello

The INDIRECT formula has a calculation overhead. If you've only one such formula, it isn't much of an impact: if you have lots, it can be. (If relevant, such a dynamic named range is not recognised when doing queries - such as databases use, with SQL, etc.)

I have around 12k formulas which use the referencing, but once they are calculated, I paste them as values in my code.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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