Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 989
Default Q: Named range based on cell value?

I want to do a vlookup based on a range that is based on a cell.

So, if cell A1 = "CA" use the CA_REG named range in my formula.
If cell A1 = "NV" use the NV_REG named range in my formula.
etc. etc.

There will be about a dozen values that the cell can have, so I can't use a
nested if.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Named range based on cell value?

Try something like the following:

=VLOOKUP(xyz,INDIRECT(INDEX({"CA_REG","NV_REG","AB _REG"},0,MATCH(A1,{"CA","NV","AB"},0))),2,FALSE)

Change the 'xyz' to the value you want to look up with VLOOKUP.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Mark" wrote in message
...
I want to do a vlookup based on a range that is based on a cell.

So, if cell A1 = "CA" use the CA_REG named range in my formula.
If cell A1 = "NV" use the NV_REG named range in my formula.
etc. etc.

There will be about a dozen values that the cell can have, so I can't use
a
nested if.

Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 989
Default Named range based on cell value?

Thanks!!! Works great!

"Chip Pearson" wrote:

Try something like the following:

=VLOOKUP(xyz,INDIRECT(INDEX({"CA_REG","NV_REG","AB _REG"},0,MATCH(A1,{"CA","NV","AB"},0))),2,FALSE)

Change the 'xyz' to the value you want to look up with VLOOKUP.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Mark" wrote in message
...
I want to do a vlookup based on a range that is based on a cell.

So, if cell A1 = "CA" use the CA_REG named range in my formula.
If cell A1 = "NV" use the NV_REG named range in my formula.
etc. etc.

There will be about a dozen values that the cell can have, so I can't use
a
nested if.

Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 989
Default Named range based on cell value?

By the by, using your formula as a template, I think I found a bit of a
slimmer solution:

=VLOOKUP("xyz",CHOOSE(MATCH(A2,{"CA","NV"},0),CA_R EG,NV_REG),2,FALSE)

So far, it seems to work. And again, thank you so much for your solution.

-Mark



"Chip Pearson" wrote:

Try something like the following:

=VLOOKUP(xyz,INDIRECT(INDEX({"CA_REG","NV_REG","AB _REG"},0,MATCH(A1,{"CA","NV","AB"},0))),2,FALSE)

Change the 'xyz' to the value you want to look up with VLOOKUP.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Mark" wrote in message
...
I want to do a vlookup based on a range that is based on a cell.

So, if cell A1 = "CA" use the CA_REG named range in my formula.
If cell A1 = "NV" use the NV_REG named range in my formula.
etc. etc.

There will be about a dozen values that the cell can have, so I can't use
a
nested if.

Any ideas?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
How Do I Do an Exclude Filter based on a Named Range? Dawg House Inc Excel Worksheet Functions 8 April 11th 06 02:49 AM
Return entries from one named range based on the contents of another Sam Crump Excel Worksheet Functions 1 March 6th 06 04:00 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM


All times are GMT +1. The time now is 10:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"