Defined Names - Excel Performance

smitpau

Board Regular
Joined
Apr 2, 2020
Messages
139
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:
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,118
Office Version
  1. 2016
Platform
  1. Windows
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
 

smitpau

Board Regular
Joined
Apr 2, 2020
Messages
139
Office Version
  1. 365
Platform
  1. Windows
Okay thanks.

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

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,118
Office Version
  1. 2016
Platform
  1. Windows
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.
 

smitpau

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

ADVERTISEMENT

Okay thanks for the help Jaafar Tribak I'll give that code a go.
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,118
Office Version
  1. 2016
Platform
  1. Windows
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.
 

smitpau

Board Regular
Joined
Apr 2, 2020
Messages
139
Office Version
  1. 365
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,133
Messages
5,599,910
Members
414,346
Latest member
mmoose

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
Top