If and Vlookup

dneas

New Member
Joined
Mar 3, 2002
Messages
34
Do you have to use another value to get the formula to give you a "0" if the vlookup is not false?

=IF(VLOOKUP(B5,'[2004 PO''s.xls]PPV'!$A$5:$B$567,2,FALSE)="#N/A","0",VLOOKUP(B5,'[2004 PO"s.xls]PPV'!$A$5:$B$567,2,FALSE))
 

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.
You have to have an answer for the entry. If you use "", the answe will be blank in the cell.
 
Upvote 0
You're on the right track but you can't quite do it that way, try this

=IF(ISNA(VLOOKUP(B5,'[2004 PO''s.xls]PPV'!$A$5:$B$567,2,FALSE)),0,VLOOKUP(B5,'[2004 PO"s.xls]PPV'!$A$5:$B$567,2,FALSE))
 
Upvote 0
When I use your formula with the ISNA the non-matches are OK but the matches still give a #n/a for some reason?
 
Upvote 0
I'm not sure how that would happen, have you modified the formula at all, it should work as per this example
Book1
ABCDEF
3
4lookupresult
5bananas2lemons4
6grapes3bananas2
7lemons4grapefruit0
8kumquat5
9
Sheet1


Formula in E5 copied down column

=IF(ISNA(VLOOKUP(D5,$A$5:$B$567,2,0)),0,VLOOKUP(D5,$A$5:$B$567,2,0))
 
Upvote 0
Thank you

It worked when I changed the first lookup to 0 and the second one to false.

Thank you very much for your help.

=IF(ISNA(VLOOKUP(B5,Sheet2!$B$2:$C$564,2,0)),0,VLOOKUP(Sheet1!B5,Sheet2!$B$2:$C$564,2,FALSE))
 
Upvote 0
FALSE or 0 for the 4th Argument of a VLOOKUP should be equivalent, switching one for the other should make no difference....but I'm happy that you have it working.....
 
Upvote 0

Forum statistics

Threads
1,214,278
Messages
6,118,638
Members
448,844
Latest member
Jayee04e

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
Back
Top