Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - reading a named range into a formula

Status
Not open for further replies.

TFlanagan

MIS
Mar 19, 2009
8
US
Good morning. I have a worksheet with several named ranges. On a second sheet I am constructing a chart whereby the user can enter one of the named ranges and the chart automatically updates with the data pertinent to that particular named range. The difficulty I have is in looking up the data. When I hard-code my named range into HLOOKUP, it works correctly.
ex: =HLOOKUP(B1,NAMEDRANGE,2,FALSE)

But when I attempt to refer to the named range via the cell the user enters the named range into I get a VALUE error.
ex: user enters NAMEDRANGE into cell A1. The formula
=HLOOKUP(B1,A1,2,FALSE) evaluates A1 as “NAMEDRANGE” (text) and not as a named range.

How can this be accomplished?

Thank you.
 



hi,
[tt]
=HLOOKUP(B1,INDIRECT(A1),2,FALSE)
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
That was one of the things I tried. Excel evaluates INDIRECT(A1) as INDIRECT("NAMEDRANGE") which then goes to
=HLOOKUP(B1,#REF!,2,FALSE)

What Excel needs to do is somehow read the text that is entered in A1 not as text but as a named range. Is there a UDF maybe that does that?
 



What you need to have in A1 is the NAME of the range that is selected for the chart.

Personally, I would not use multiple named ranges.

I would use ONE named range and FILTER the data to be displayed on the chart.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
TFlanagan, is the "NamedRange" spelled correctly? because this method does work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top