If (Vlookup >0) working, but what if Vlookup cell does not exist

S

Steve

This formula works if the data is present, however, I'm getting #N/A if the
lookup cell (A4) doesn't exist, which it may not on some days.

=IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)>0,VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE),"")

Can this formula be modified to also produce "" if the data representing A4
does not exist ?

Thanks,

Steve
 
B

Bernard Liengme

=IF(OR(ISNA(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)),
VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE=0,"",VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE))
best wishes
 
T

T. Valko

You have to separate the OR conditions.

If ISNA is TRUE then the separate VLOOKUP will return #N/A causing the OR to
fail.

=IF(ISNA(VLOOKUP(A4,Sat!$A$16:$J$377,9,0)),"",IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,0)=0,"",VLOOKUP(A4,Sat!$A$16:$J$377,9,0)))
 
B

Bernard Liengme

Thanks, Biff. Too little coffee today!
Bernard

T. Valko said:
You have to separate the OR conditions.

If ISNA is TRUE then the separate VLOOKUP will return #N/A causing the OR
to fail.

=IF(ISNA(VLOOKUP(A4,Sat!$A$16:$J$377,9,0)),"",IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,0)=0,"",VLOOKUP(A4,Sat!$A$16:$J$377,9,0)))
 
D

Dan

Thanks, Biff. Too little coffee today!
Bernard








- Show quoted text -

Would you not be better to test if A4 is blank rather than testing the
result of the VLookup formula? Using ISNA will filter genuine NA
messages too.

=IF(ISBLANK(A4),"",VLOOKUP(A4,Sat!$A$16:$J$377,9,FA­LSE))
 
T

T. Valko

Would you not be better to test if A4 is blank
rather than testing the result of the VLookup
formula? Using ISNA will filter genuine NA
messages too.

It sounded like that's what the OP wanted to.


--
Biff
Microsoft Excel MVP


Thanks, Biff. Too little coffee today!
Bernard








- Show quoted text -

Would you not be better to test if A4 is blank rather than testing the
result of the VLookup formula? Using ISNA will filter genuine NA
messages too.

=IF(ISBLANK(A4),"",VLOOKUP(A4,Sat!$A$16:$J$377,9,FA­LSE))
 
H

Héctor Miguel

hi, Steve !
This formula works if the data is present, however, I'm getting #N/A if the lookup cell (A4) doesn't exist, which it may not on some days.

=IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)>0,VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE),"")

Can this formula be modified to also produce "" if the data representing A4 does not exist ?

i.e. =if(countif(sat!$a$16:$a$377,a4),vlookup(a4,sat!$a$16:$j$377,9,0),"")

hth,
hector.
 
J

Jacob Skaria

=IF(ISNA(VLOOKUP(A4,SAT!$A$16:$J$377,9,0)),"",
IF(VLOOKUP(A4,SAT!$A$16:$J$377,9,0)>0,
VLOOKUP(A4,SAT!$A$16:$J$377,9,0),""))

If this post helps click Yes
 
J

JeffK

=if(a4="","",IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)>0,VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE),""))

Try this
 
S

Sean Timmons

=IF(OR(iISNA(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)),VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)=0),"",VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE))
 
S

Squeaky

Sure,

=IF(ISNA(IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)>0,VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE),"")),"",IF(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)>0,VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE),""))

Squeaky
 
K

Kassie

=IF(ISNA(VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE)),"",VLOOKUP(A4,Sat!$A$16:$J$377,9,FALSE))
--
HTH

Kassie

Replace xxx with hotmail
 
S

Steve

Thanks everybody.

I'm amazed at the variety of the responses. Most worked great. Those that
didn't didn't because I wasn't too clear on what I needed. I'll just ID those
that worked with the green checkmark, and comment on the others. Thanks again.

Steve
 
S

Steve

I guess I wasn't too clear, because the A4 on this sheet will always be
there. It's the A4 lookup on Sat that may or may not be there.

Thaanks,

Steve
 
D

Dan

I guess I wasn't too clear, because the A4 on this sheet will always be
there. It's the A4 lookup on Sat that may or may not be there.

Thaanks,

Steve







- Show quoted text -

=IF(OR(ISBLANK(A4),ISBLANK(Sat!A4)),"",VLOOKUP(A4,Sat!$A$16:$J
$377,9,FA­LSE))

This will test both A4 on the current sheet and A4 on the sheet Sat
 
S

Steve

It's still producing the #N/A when the data in the A4 cell not on the Sat
tab. Also, the when it is on the Sat tab, it won't be in Sat!A4, in fact, it
may be anywhere in the A column.

Thanks,

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top