Conditional format date if it matches two conditions

cpereznj

New Member
Joined
Nov 27, 2012
Messages
19
I have searched the web for a solution to my question with no luck. Here is my issue:
I have cell A1 with a date (any date), I also have two named ranges. One named Holidays and the other one named Payroll. They are used to identify the company's holidays and the payroll dates.
I need to conditional format cell A1 if the date matches a date in the Holidays range and a date in the Payroll range. Tried unsuccessfully the following formula: =AND(A1=Holidays,A1=Payroll). I have used =OR(A1=Holidays) plus =OR(A1=Payroll). Both work properly. However, I need it to work if both conditions are met not separately. Any help will be appreciated.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Holidays and Payroll have more than one date, right? So just A1=Holidays or A1=Payroll fail.

Try this:
=NOT(ISNA(MATCH(A1,Holidays,0)+MATCH(A1,Payroll,0)))
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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