Hey gang-
Say I have a number of named ranges, which are different lookup tables. Then I have two named cells, one which does some magic to determine the lookup_value for a VLOOKUP, and one which does some magic to determine the table_array [which of the named ranges]. I'm having trouble using the value of one of the "magic" cells as the lookup_value in the VLOOKUP formula. I was able to use INDIRECT for the table_array part of the formula, but it doesn't seem to be working for the lookup_value part.
EXAMPLE
I have NamedRangeA, and NamedRangeB [both lookup tables].
I have MagicCellA, which determines that the value to be looked up is 5555.
I have MagicCellB, which determines that the named range in which to lookup the value NamedRangeB.
My formula:
=VLOOKUP(MagicCellA,INDIRECT(MagicCellB),2,FALSE)
results in a Value Not Available error.
I know that the table_array part is working, because the formula:
=VLOOKUP(5555,INDIRECT(MagicCellB),2,FALSE)
returns the correct value. All I've done is put in 5555 manually, rather than using MagicCellA.
I think it's looking for the text MagicCellA, rather than the value of MagicCellA, or something like that - which is why I used INDIRECT on the table_array part. Yet the formula:
=VLOOKUP(INDIRECT(MagicCellA),INDIRECT(MagicCellB),2,FALSE)
doesn't work either.
Can anyone see what I'm doing wrong? Thanks very much in advance,
joe
Bookmarks