# Thread: IF and VLOOKUP Thanks: 0 Likes: 0

1. ## IF and VLOOKUP

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!

2. ## Re: Help witth IF and VLOOKUP

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

3. ## 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?

4. ## 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)?

5. ## Re: Help witth IF and VLOOKUP

Originally Posted by Fluff
Hi & welcome to MrExcel
=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!

6. ## Re: Help witth IF and VLOOKUP

You're welcome & thanks for the feedback