# Urgent Help Required

#### geor68

##### New Member
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

### 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
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
However, 1 way to simplify it using only "psudo-code" is to use just one vlookup...

=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
jonmo1 - you Sir are a genius. MANY THANKS.

geor68

#### geor68

##### New Member

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

#### MrRajKumar

##### Active Member
Try this a shot,

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

#### geor68

##### New Member
MrRajKumar - cheers for the solution. Whats the correct syntax for wrapping an ISNA command round that?

#### MrRajKumar

##### Active Member
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

Replies
1
Views
199
Replies
1
Views
54
Replies
1
Views
194
Replies
0
Views
347
Replies
1
Views
196