Merv Merzoug
Merv Merzoug

Reputation: 1237

Excel not properly comparing dates, despite same cell format

I have two date rows. Both are formatted as dates. When I do a logic test to see whether the two dates, excel is not recognizing them as the same.

Here is a screenshot of the cells: enter image description here

This is to confirm that both cell rows are formatted as date: enter image description here

This is to confirm that the equality check row is referencing the right cells:

enter image description here

I'm stumped. Does anyone have any idea what's going on here? Thanks

Upvotes: 0

Views: 1849

Answers (3)

teylyn
teylyn

Reputation: 35915

Format can mask the real cell value. Format both cells as General, then you can see the difference.

If a cell stays a "date" when it is formatted as General, then the cell is most likely text, not a date.

When formatted as General, you can clearly see if the number has any decimals, i.e. time on top of the date.

Upvotes: 0

Frank Ball
Frank Ball

Reputation: 1126

If you want to compare just the dates use:

=Floor(G4,1) = Floor(G6,1)

Upvotes: 1

urdearboy
urdearboy

Reputation: 14580

If you have confirmed that both are actually dates, and not text masquerading as dates, then time is most likely the issue. Note that time is represented via the decimal such that .5 equals noon.


Assuming you just want to know if the dates match independent of time you can use

INT(G4) = INT(G6)

Upvotes: 1

Related Questions