range label works in VLOOKUP except if refenced in another cell

B

brewmaker

I'm getting N/A message in VLOOKUP formula if I reference a range name in
another cell. I setup the range name and formula correctly becuase it works
when I enter the range name directly into the formula.

For example:
=VLOOKUP(G2,MS344,E2) returns the correct results. MS344 is my range name.
The cells G2 & E2 feed values into the formula.

=VLOOKUP(G2,F2,E2) returns #N/A. Cell F2 contains the range name MS344.
I tried formatting cell F2 different ways and changing relative cell
references to absolute references. Nothing works, suggestions appreciated.
 
T

T. Valko

Try it like this:

=VLOOKUP(G2,INDIRECT(F2),E2)

If MS344 is a dynamic range defined with functions like OFFSET then the
above won't work.
 
B

brewmaker

Yes, your advice worked. Many thanks!!

T. Valko said:
Try it like this:

=VLOOKUP(G2,INDIRECT(F2),E2)

If MS344 is a dynamic range defined with functions like OFFSET then the
above won't work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top