Vlookup - ignore blank cells

TheTassieBFG

New Member
Joined
Jun 2, 2014
Messages
17
Hi again hoping someone can help with the latest problem in my pet project.

I am creating annual planner style spreadsheet and am having issues with a vlookup formula

current formula
=IF(ISERROR(VLOOKUP(O143,'Holidays & Observances'!$B$3:$D$52,2,FALSE))=TRUE,"",VLOOKUP(O143,'Holidays & Observances'!$B$3:$D$52,2,FALSE))

which removes the #N/A error for those dates that do not have a holiday but as can be seen in the first table returns the name of the first blank cell.

I understand that vlookup is returning the first cell with the same value as (O15) which is blank, however having lots of this "New Years Holiday" in cells with a blank date in Table 1 is not helpful. is there a way to have vlookup ignore blank cells?

The holidays in these later cells are ones that only happen if the actual holiday (in this case new years) falls on the weekend and the public holiday falls on the next working day. There are four holidays were this occurs so they need to be kept in the range but ignored for the years they are not used.

Table 1: Calendar (P15 - should be blank)

OP
15New Years Day Holiday
16
17
18
1901New Years Day
20
21
22
2302
24
25
26

<tbody>
</tbody>




Table 2:Holidays & Observances
BCD
public holidays
301 Jan 14New Years Dayh
406 Jan 14Epiphanyco
508 Jan 14Devonport Cupo
....MOREDATES
41New Years Day Holiday

<tbody>
</tbody>
any assistance greatly appreciated
Andrew

<tbody>
</tbody>
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
SOLVED
Sorry could not see how to edit thread to show in thread title

Had been playing around with a formula tonight but hadn't been able to make it work, go to bed and it strikes me that I had been telling it to look in the wrong place for a blank cell

new formula (based on one found on the web)
=IF(OR(O7="",ISERROR(VLOOKUP(O7,'Holidays & Observances'!$B$3:$D$52,2,FALSE)))=TRUE,"",VLOOKUP(O7,'Holidays & Observances'!$B$3:$D$52,2,FALSE))

i had been trying to to have the formula ignore blanks in Table2: Holidays & Observances when it should have just been ignoring the blanks in table 1.

thanks for looking - now back to bed for the remaining hours of the night :)
Andrew

<colgroup><col width="199"></colgroup><tbody>
</tbody>


<colgroup><col width="199"></colgroup><tbody>
</tbody>
 
Upvote 0
The Quick answer would be to also us an IsBlank and a 2nd if statement.

=IF(ISBLANK(O143),"",IF(ISERROR(VLOOKUP(O143,'Holidays & Observances'!$B$3:$D$52,2,FALSE))=TRUE,"",VLOOKUP(O143,'Holidays & Observances'!$B$3:$D$52,2,FALSE)))

Or if you are using Excel 2007 or later


=IFERROR(IF(ISBLANK(O143),"",VLOOKUP(O143,'Holidays & Observances'!$B$3:$D$52,2,FALSE)),"")
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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