In this article we will learn how to use IF function to compare dates of two cells in Microsoft Excel 2010.
Before using the formula you should understand how the “IF” function works?
IF: -IF condition allowsthe user to use multiple conditions in a cell. It helps us to create the flexibility of the function in Microsoft Excel 2010 & Microsoft Excel 2013. Excel allows upto 64 conditions which can be checked in a cell through this function.
Syntax of “IF” function: =if (logical test, [value_if_true], [value_if_false])
Let’s take an example and understand how you can use the IF function to compare dates in excel.
I have data in range A2:B10, in which column A contains the 1stset of Dates and column B contains the 2ndset of Dates. I would like to write an “IF” function which states that if the date in A2 is the same or earlier than the date in B2 than display “YES” and if not than display “NO”. To compare the dates in the 2 columns follow the below mentioned steps:-
You can see in the above picture that the comparison has been performed and the function has returned a YES or NO.
To ensure that this function works correctly and gives you the right result each time, you need to ensure that both the columns are formatted in the same way. The date format should be the same so that it compares the correct dates and returns the right values.
If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook.
We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at firstname.lastname@example.org
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.