Combining functions for multiple dates

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a table with a cell that contains this function

Excel Formula:
=IF([Date]=DATE(YEAR([Date]),1,1),INDEX(Sheet2!$A$5:$E$12,MATCH([Service],Sheet2!$A$5:$A$12,0),MATCH("Public_holiday",Sheet2!$A$5:$E$5,0)), 0)

This formula looks up the cost of a public holiday in another sheet if the date in the date column is new years day of any year. I want that same cell to look up the same cost if the date is Christmas or Boxing day. How do I combine the function to check if it is the 25/12 or 26/12 for any year?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I worked it out

Excel Formula:
=IF(OR([Date]=DATE(YEAR([Date]),1,1),[Date]=DATE(YEAR([Date]),12,25),[Date]=DATE(YEAR([Date]),12,26)),INDEX(Sheet2!$A$5:$E$12,MATCH([Service],Sheet2!$A$5:$A$12,0),MATCH("Public_holiday",Sheet2!$A$5:$E$5,0)), 0)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,478
Messages
6,125,040
Members
449,205
Latest member
Eggy66

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