Urgent Help Required

geor68

New Member
Joined
Mar 24, 2011
Messages
18
Hi,

I have an excel spreadsheet that involves a rather large formula that uses IF VLOOKUP it returns False in the cell when no data has been entered in another cell. I now need to use the function ISNA to make the cell blank - the formula is now even larger and syntactically incorrect. Can someone please help me correct it. The formula in English is If X1="A" then lookup X1 in the range R2:T30, if X1="B" then lookup X1 in the range U2:W30, if X1="C" then lookup X1 in the range Y2:AA30. I've got this to work. How do I add the ISNA fuction? Any help would be gratly appreciated.

Regards

geor68
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Welcome to the board...

I'm thinking an even better way to do it...
However, please post your actual formula, because my idea will need specifics, not generalizations and simplified example "psudo-code"
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
However, 1 way to simplify it using only "psudo-code" is to use just one vlookup...

instead of
=IF(A1="X",VLOOKUP(value, range1,2,0),IF(A1="Y",VLOOKUP(value, range2,2,0)..etc..

do

=VLOOKUP(value,IF(A1="X",Range1,IF(A1="Y",Range2)),2,0)

Then wrap it in an ISNA

=IF(ISNA(VLOOKUP(value,IF(A1="X",Range1,IF(A1="Y",Range2)),2,0)),"",VLOOKUP(value,IF(A1="X",Range1,IF(A1="Y",Range2)),2,0))
 
Last edited:

geor68

New Member
Joined
Mar 24, 2011
Messages
18

ADVERTISEMENT

What would be the correct syntax for 3 ranges - X, Y and Z?
 

MrRajKumar

Active Member
Joined
Jan 29, 2008
Messages
260
Try this a shot,

=VLOOKUP(Value,CHOOSE(MATCH(A1,{"X","Y","Z"},0),Range1,Range2,Range3),2,FALSE)
 

geor68

New Member
Joined
Mar 24, 2011
Messages
18
MrRajKumar - cheers for the solution. Whats the correct syntax for wrapping an ISNA command round that?
 

MrRajKumar

Active Member
Joined
Jan 29, 2008
Messages
260
Try these,

If your, VLOOKUP out put is Number;

=LOOKUP(1E+307,CHOOSE({1,2},0,VLOOKUP(Value,CHOOSE(MATCH(A1,{"X","Y","Z"},0),Range1,Range2,Range3),2,FALSE)))

If it is text;

=LOOKUP(REPT("Z",250),CHOOSE({1,2},"",VLOOKUP(Value,CHOOSE(MATCH(A1,{"X","Y","Z"},0),Range1,Range2,Range3),2,FALSE)))

Raj
 

Watch MrExcel Video

Forum statistics

Threads
1,108,959
Messages
5,525,899
Members
409,671
Latest member
nasseralateek

This Week's Hot Topics

Top