IF and VLOOKUP

Ale0496

New Member
Joined
Jun 19, 2019
Messages
2
Hello!

I'm trying to set a formula that if cell B5 has text, then it activates the VLOOKUP on a database on another sheet, however, I'm trying to get that if the cell on the database is blank it does not show 0.

So far I got this formula:

=IF(ISTEXT(B4),VLOOKUP(B4,Sheet2!A4:H11001,7,FALSE),"")

However I'm not sure how to make sure that it doesn't show a 0.

Does anybody know how to get it to not show a 0 if it is blank?

Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Re: Help witth IF and VLOOKUP

Hi & welcome to MrExcel
How about
=IF(ISTEXT(B4),if(VLOOKUP(B4,Sheet2!A4:H11001,7,FALSE)=0,"",VLOOKUP(B4,Sheet2!A4:H11001,7,FALSE)),"")
 
Upvote 0
Re: Help witth IF and VLOOKUP

Goto File -> Options -> Advanced -> Under 'display options for this workbook' uncheck "Show a zero in cells that have zero value"

does that work for you?
 
Upvote 0
Re: Help witth IF and VLOOKUP

You wrote "if cell B5 has text" but your IF statement checks B4. And, are you looking to return the result from column G (that's the 7th column)?
 
Upvote 0
Re: Help witth IF and VLOOKUP

Hi & welcome to MrExcel
How about
=IF(ISTEXT(B4),if(VLOOKUP(B4,Sheet2!A4:H11001,7,FALSE)=0,"",VLOOKUP(B4,Sheet2!A4:H11001,7,FALSE)),"")

Thank you so much! That formula worked perfectly!
 
Upvote 0
Re: Help witth IF and VLOOKUP

You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

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