In this article, we will compare dates using the IF function in Excel 2016. IF function works on the logic test and returns the output on the basis of the test.
IF function tests the condition and returns value either it's True or False.
Syntax of IF function:
Here is an example to show how to compare dates in excel. How do we check if dates are greater than or equal to, does not equal to, less than, etc in excel
We have two lists named Date Column 1 and Date Column 2. We will compare the two lists using the IF function.
Now we will use the IF function in C2 cell
|=IF( A2<B2 , "No" , "Yes" )|
A2<B2 logic_test to compare dates and returns the values corresponding to it.
“No” value returned if the condition comes True
"Yes" value returned if the condition comes False
Copy the formula in other cells, select the cells taking the first cell where the formula is already applied, use shortcut key Ctrl+ D.
Your Formula will be pasted using the shortcut and the resulting output will be as shown below.
If Dates in Column 2 is greater than Dates in Column 1, No is the response or else then Yes is the response as shown in the above image.
This was an example showing one of the features of the IF function in Excel 2016. Please find more Logic_test function here. If you have any query about the IF function, please do share it in the comment box below. We will help you.
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.