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!
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,791
Office Version
365
Platform
Windows
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)),"")
 

Danmc

New Member
Joined
Nov 19, 2015
Messages
33
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?
 

kweaver

Well-known Member
Joined
May 8, 2018
Messages
1,039
Office Version
365, 2010
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)?
 

Ale0496

New Member
Joined
Jun 19, 2019
Messages
2
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!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,791
Office Version
365
Platform
Windows
Re: Help witth IF and VLOOKUP

You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,099,249
Messages
5,467,529
Members
406,544
Latest member
semoredhawk

This Week's Hot Topics

Top