Formula required for conditional formatting

Arts

Well-known Member
Joined
Sep 28, 2007
Messages
765
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all

I was trying to run a basic formula to match two dates and if they matched the cell would then highlight. (I have a a huge row of dates)

I had Mar 25 in one row and Mar 25 in another row (E21 and L21) and these were not matching. What I then found was that the date of these were slightly different as the formatting was showing Mar 25 the actual dates were 02/03/25 and 18/03/25.

If I could just match the month and year and exclude the day that would be super helpful, so if both values have Mar 25 that would be seen as a match irrespective of the day.

As always appreciate any assistance with this.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
you can use the =EOMONTH() function effectively ignore the day with just year and month.

Book1
AB
125-Mar-2505-Mar-25
2
3FALSE
4TRUE
Sheet1
Cell Formulas
RangeFormula
B3B3=AND(A1=B1)
B4B4=AND(EOMONTH(A1,0)=EOMONTH(B1,0))
 
Last edited:
Upvote 0
Solution
you can use the =EOMONTH() function effectively ignore the day with just year and month.

Book1
AB
125-Mar-2505-Mar-25
2
3FALSE
4TRUE
Sheet1
Cell Formulas
RangeFormula
B3B3=AND(A1=B1)
B4B4=AND(EOMONTH(A1,0)=EOMONTH(B1,0))

Brilliant thank you so much! Does exactly what I needed.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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