Referencing a named range from a cell

lbird2

Board Regular
Joined
Dec 10, 2014
Messages
78
Office Version
  1. 365
Platform
  1. Windows
I think this is an easy one.

Say I have three named ranges; one, two, three. Cell A1 contains one of these three based on condition from elsewhere. How can I use the contents of A1 as a named range in a formula? For example, if A1="two", lookup (C7, A1, 3, FALSE) would evaluate as (C7, two, 3, FALSE).
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
To reference ranges "indirectly" like that, you would use the INDIRECT function, i.e.
Excel Formula:
=VLOOKUP(C7,INDIRECT(A1),3,FALSE)
 
Upvote 0
Solution
If you only have a few, you can use switch like
Excel Formula:
=VLOOKUP(C7,SWITCH(A1,"one",one,"two",Two,"three", three),3,0)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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