Named Reference

workharder

New Member
Joined
Jan 30, 2012
Messages
5
I have created a named reference that stores functions to get around the 7 nested if statement limit for functions. However when I add the reference in the name manager, it automatically appends the current worksheet name in the variables.

original formula:
Code:
=IF($P$8>1.06,0.04,IF($P$8>=1.041,0.03,IF($P$8>=1.021,0.02,IF($P$8>=1.001,0.01,0))))
When i add the reference it changes to:
Code:
=IF(Template!$P$8>1.06,0.04,IF(Template!$P$8>=1.041,0.03,IF(Template!$P$8>=1.021,0.02,IF(Template!$P$8>=1.001,0.01,0))))
I need to use this reference in multiple worksheets. How can i make the function reference the current active worksheet?

I have tried to use
Code:
CELL("filename",$P$8)
but it still appends the current worksheet name I currently have selected when changing the formula.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Welcome to the board...

To answer the question directly..
To make a named range refer to whatever sheet the formula is entered in, enter it with !

Example
=!A1
instead of
=Sheet1!A1
 
Upvote 0
Now to give the best advice I can..
There is no need to nest more than 7 if's..
Whenever you have a need to nest if's like that, there is almost certainly a better/more efficient way..

In this example, lookup is perfectly suited for the task.
Try
=LOOKUP($P$8,{0,1.001,1.021,1.041,1.061},{0,0.01,0.02,0.03,0.04})
 
Upvote 0
Thanks for the warm welcome.

I cant believe I didnt just try ! !!!! I tried a few things. Sometimes the solution is easier than you anticipate. I didnt look into the lookup function mostly because the formula for each cell is reliant on the value of a different cell. Essentially 6 of those formulas for each cell with no macros or vb. I was trying to not get lost in my formulas.

Thanks again for the help!!
 
Upvote 0
Glad to help, thanks for the feedback...


Hey, don't worry about know trying it before.
If I remember, I figured that one out one day by accident...
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,999
Members
452,373
Latest member
TimReeks

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