Add a condition to an Excel formula to include when date in one cell equals date in another cell

Andreamary
Andreamary used Ask the Experts™
on
Column AH = Date WO was completed
Column AI = Deadline date

My formula below indicates whether the WO was completed by the deadline or not:

=IFERROR(IF($AH2="","",IF($AH2<$AI2,"Yes","No")),"")

I need the above formula to be modified to include the additional condition below:

If AH2 = AI2, the result is also 'Yes' (the deadline was met)

Thanks!
Andrea
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Andrea,

This was simple :)  just to add <=
=IFERROR(IF($AH2="","",IF($AH2<=$AI2,"Yes","No")),"")

Author

Commented:
Thanks for the quick response, Shums! For some reason, the results I'm getting are still showing the deadline isn't met if AH2 = AI2. It appears that column AH includes a date and time stamp, whereas column AI only includes the date. Is it possible for the formula to ignore the time stamp, and if so, do you think that would resolve the issue?
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Show me the format of both the columns
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Managing Director/Excel VBA Developer
Distinguished Expert 2018
Commented:
If that's the case, then try below:
=IFERROR(IF($AH2="","",IF(TEXT($AH2,"dd-mm-yyyy")<=TEXT($AI2,"dd-mm-yyyy"),"Yes","No")),"")
try this:
=IFERROR(IF($Ah2="","",IF(DATEVALUE(TEXT($Ah2,"DD/MM/yy"))<=$ai2,"Yes","No")),"")

Author

Commented:
That did the trick! Thanks, Shums!
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Pleased to help Andrea!

Arana great formula

Author

Commented:
Hi Arana,

I'm sorry, but I had already closed the question before I saw your response, which also worked. Thanks very much!

Andrea
Nothing to be sorry about, glad it worked, it was in fact Shum's answer just adjusted for your comment about time stamp, all credit goes to him, just wanted to give you an alternate way to do it , as a future reference.
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Andrea,

Please request to re-open your question and split the points, Arana's solution is as helpful as mine.

Author

Commented:
Thanks, Shums, I'll follow up...

Andrea

Author

Commented:
Thanks very much, Kyle!

Author

Commented:
Thanks again to you both! And thanks, Shums, for arranging for the question to be reopened so I could share the points!

Cheers,
Andrea
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
You're Welcome Andrea! Glad we both were able to help you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial