How to reference a named data range in a formula using a cell reference ?????

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
266
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have formula as per below - it works fine.

{=LARGE(IF(Departments=B2,Margin),B5)}

I have the word "margin" in cell X1, when I replace it in the formula as follows:

{=LARGE(IF(Departments=B2,X1),B5)}

is does not work...

Any help, greatly appreciated.

Thanks - Mark.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hello,

Value of X1 is a pure text for this formula, not a range. You have to force-translate it into named range for a formula.

Try to replace X1 with this:

INDIRECT($X$1,1)

So your formula would look like this:


{=LARGE(IF(Departments=B2,INDIRECT(X1,1)),B5)}
 
Upvote 0
Hi Guys - Thanks for your help on this - worked a treat!!

I Used the indirect function as per AliGW and it was fine - Thanks nardagus for also chipping in - really appreciate it.

I tried to use the indirect function on a command - I have a drop down list with Large and Small as options, in cell A1, any ideas as to how to reference this in the following formula {=IFERROR(LARGE(IF(Departments=$B$4,INDIRECT($D$4)),B7),"")} I tried =IFERROR(indirect(a1)(IF(Departments=$B$4,INDIRECT($D$4)),B7),"") - but did not work out??
 
Upvote 0
Not tested, but try this:

=IFERROR(&"indirect(a1)"&(IF(Departments=$B$4,INDIRECT($D$4)),B7),"")

or

=IFERROR("indirect(a1)"(IF(Departments=$B$4,INDIRECT($D$4)),B7),"")
 
Last edited:
Upvote 0
No joy with either....the entire formula is highlighted when the error message comes up?
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,945
Members
449,275
Latest member
jacob_mcbride

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