Conditional Formatting for when the month/year date for the same ID on two worksheets doesn't match

slam

Well-known Member
Joined
Sep 16, 2002
Messages
921
Office Version
  1. 365
  2. 2019
On a worksheet named Date Issues, I have a list of ID's in column B, and a date in column AF in the format DD-MMM-YYYY. This date could be any day of the month.

On a worksheet named Financial Issues, I have the same list of ID's in column A. In column D on this worksheet, I have dates in the same DD-MMM-YYY format, but this will always be the 1st of the month.

I need conditional formatting in this column D to identify where the month and year do not match the month and year from the Date Issues worksheet for the same ID.

Is this possible? Could I please trouble someone for the conditional formatting formula for this?

Both worksheets have column headers, and this is for Excel 365.

Thanks! ❤️
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
i have used a different cell to AF - just to get all on the screen

=NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$28,MATCH('Date Issues'!B2,'Date Issues'!$B$2:$B$28,0)),0)=EOMONTH(D2,0))

I'm sure there would be a way to use countif based on 1st of month - but this is what i came up with

finacial sheet
Book1
ABCDEF
1IDDate 1st
214/1/24FALSE
327/1/24TRUE
438/1/24FALSE
5412/1/24TRUE
6
7
8
9
10
11
12
13
14
15
Fiancial
Cell Formulas
RangeFormula
F2:F5F2=NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$28,MATCH('Date Issues'!B2,'Date Issues'!$B$2:$B$28,0)),0)=EOMONTH(D2,0))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:D33Expression=NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$28,MATCH('Date Issues'!B2,'Date Issues'!$B$2:$B$28,0)),0)=EOMONTH(D2,0))textNO


date issues
Book1
ABCAEAFAGAH
1IDDate
214/23/24
326/19/24
438/11/24
544/23/24
6
7
Date Issues


 
Upvote 1
Solution
Thank you so much!

This is working perfectly until I do a sort on the data. Do I need to make something else absolute?

Excel Formula:
=IFERROR(NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$200,MATCH('Date Issues'!B2,'Date Issues'!$B$2:$B$200,0)),0)=EOMONTH(D2,0)),FALSE)
 
Upvote 0
Just noticed an issue, which is it looks like it is giving a few false positives. I can't really see a pattern or reason why. Currently I have 112 rows of data, and only 6 are wrong. You can see below that the month and year matches between the two worksheets, but these are all highlighted via the conditional formatting, which they should not be. The other 106 are correctly highlighted/not highlighted.

Financials | Date Issues

01-Jan-2023 08-Jan-2023
01-Apr-2024 01-Apr-2024
01-Jan-2024 02-Jan-2024
01-Jun-2023 30-Jun-2023
01-Sep-2023 07-Sep-2023
01-Sep-2024 02-Sep-2024
 
Upvote 0
sorting should not make any difference as its using an exact match
are all the dates REAL dates on not text by any chance , maybe gives an error

if you select the entire columns of dates and change the format to general
so they all change to a number

for example those dates are

Book1
AB
14492744934
24538345383
34529245293
44507845107
54517045176
64553645537
Sheet1
 
Upvote 0
Yes, they're all real dates. Already converted their format with ASAP utilities to ensure this, and at your recommendation changed the format to General, and they do indeed all change to numbers like those on both worksheets.

I see that when using the formula in an adjacent column, rather than as conditional formatting, when I sort, I see the formula changes per below. Is this correct? The data on Financials and Date Issues can be different data, and in a different order.

=NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$300,MATCH('Date Issues'!B2,'Date Issues'!$B$2:$B$300,0)),0)=EOMONTH(D2,0))

to

=NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$300,MATCH('Date Issues'!B79,'Date Issues'!$B$2:$B$300,0)),0)=EOMONTH(D2,0))
 
Upvote 0
Ah, did I figure it out? Was one reference pointing to Date Issues when it should have been pointing to Financials? (A2 below)

Excel Formula:
=NOT(EOMONTH(INDEX('Date Issues'!$AF$2:$AF$300,MATCH(A2,'Date Issues'!$B$2:$B$300,0)),0)=EOMONTH(D2,0))
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,105
Members
453,021
Latest member
Justyna P

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