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
32,270
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,792
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
32,270
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,792
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
32,270
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,082,114
Messages
5,363,244
Members
400,722
Latest member
DrewPop24

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top