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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,015
Messages
5,834,938
Members
430,327
Latest member
Mr_Himalayan778

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top