Defined Names - Excel Performance

smitpau

Board Regular
Joined
Apr 2, 2020
Messages
167
Office Version
  1. 365
Platform
  1. Windows
Hi,

I would like to use Defined Names more prevalently in my Excel files.

This comment directly below taken from decisionmodels.com has given me pause for thought.

"Defined Names are recalculated each time a formula that directly refers to the name is recalculated"

To be honest I don't quite fully understand what it means, and practically when they should/should not be used.
For example I planned on having Inputs so say Interest Rate as a defined name range but wonder if that would have a performance impact.

If the defined name is just an input value and not a formula should that be okay as there would be nothing to recalculate (within the defined name)?

Thanks,


Source:
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
If you mean that the name refers to a constant, it won't recalculate.

You can alwys test if there is a recalculation by placing this code in the Thisworkbook Module and performing a recalculation ALT+CTRL+F9 (assuming no formulaes)
VBA Code:
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
    MsgBox "Calculating"
End Sub
 
Upvote 0
Okay thanks.

So basically would it be correct to interpret that quote above as don't put formulas in defined names?
 
Upvote 0
Okay thanks.

So basically would it be correct to interpret that quote above as don't put formulas in defined names?

I am not very familiar working with defined names but I guess it is fair to assume that .
A sheet calculates only if at least one argument in a formula changes or with volatile functions ... No formulaes = No recalculation
And as I said, you can always test this in the Sheet calculate event.
 
Upvote 0
Okay thanks for the help Jaafar Tribak I'll give that code a go.

Create the defined name in blank workbook, add the code in its workbook module, edit one of the sheets to cause a recalculation or force a recalculation via ALT+CTRL+F9.
The Msgbox won't come up meaning the defined name isn't recalculated.
 
Upvote 0
So if I did something like, (Index(Defined name) to get a value, multiplied by 2), that code would also check if the defined name has been recalculated.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
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