# 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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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"

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

geor68

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

Try this a shot,

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

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

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
1K
Replies
0
Views
466
Replies
8
Views
430
Replies
0
Views
213
Replies
18
Views
1K

1,207,257
Messages
6,077,337
Members
446,278
Latest member
hoangquan2310

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back