Return a Blank if Error OR 0

The_T

New Member
Joined
Sep 30, 2018
Messages
31
Hi guys,

Wondering if anybody a help with the following:

I am currently using the following formula to return blanks when an error results from 'E25' being blank:

=IFERROR(VLOOKUP(E25,'WORKSHEET'!$A$1:$S$1000,19,FALSE,"")

However, when E25 is not blank but row '19' in '$A$1:$S$1000' has no results, the formula returns a '0'.

In the case of there being no result to return, I'd like there also to be a blank (and for there to only not be a blank when there is a result to return - 'YES or 'NO' being the only 2 returnable options in this case).

I have tried OR and AND formulae but with no success.

I'm tired so maybe I have missed something.

Any help would be much appreciated.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,567
Office Version
365
Platform
Windows
How about
=IF(VLOOKUP(E25,WORKSHEET!$A$1:$S$1000,19,FALSE)=0,"",IFERROR(VLOOKUP(E25,WORKSHEET!$A$1:$S$1000,19,FALSE),""))
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,734
Office Version
365
Platform
Windows
Hi Fluff. That would error before the iferror ever had its chance. Maybe wrap the if rather than the vlookup.

=IFERROR(IF(VLOOKUP(E25,WORKSHEET!$A$1:$S$1000,19,FALSE)=0,"",VLOOKUP(E25,WORKSHEET!$A$1:$S$1000,19,FALSE)),"")
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,567
Office Version
365
Platform
Windows
Excellent point, I obviously wasn't thinking clearly :banghead:
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,734
Office Version
365
Platform
Windows
I forget to think all the time :)

You could also do this if the lookup is producing text results:

=IFERROR(""&VLOOKUP(E25,WORKSHEET!$A$1:$S$1000,19,FALSE),"")
 

The_T

New Member
Joined
Sep 30, 2018
Messages
31
Hi guys, thanks a lot for the replies.

Will give both options a go and get back to you!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,567
Office Version
365
Platform
Windows
Don't bother trying my suggestion from post#2, as Steve pointed out it won't always work.
 

The_T

New Member
Joined
Sep 30, 2018
Messages
31
Thanks for your help guys.

Steve the Fish - Your solution works perfectly. You are clearly either a genius or some sort of divine entity.

Cheers!
 

Forum statistics

Threads
1,078,500
Messages
5,340,743
Members
399,393
Latest member
farlow

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top