Method 1 – Use a Formula to Compare If a Date Is Before Another Date
Steps:
- Select a cell to write a formula. We selected cell (E5).
- Apply the following formula-
=C5<=D5
- Press the Enter button, and you will get the result. It returned “True” as the “Submission Date” is less than the “Submission Deadline”. The result will be “False”.
- Drag the “fill handle” down to fill the cells with the desired output.
- We compared two dates to determine if one was before the other date or not.
Method 2 – Utilize the IF Function to Compare If a Date Is Before Another Date
Steps:
- Choose a cell (E5) to apply the formula.
- Put the formula down-
=IF(C5<=D5,"On time","Late submission")
Where,
- The IF function checks whether the condition is met and then returns a defined statement based on the given condition.
- Click the Enter button and pull the “fill handle” down to get the desired output.
- We compared two dates and got our output in the status column.
Method 3 – Insert Date in Formula to Compare If Date Is Before Another Date
Steps:
- Choose a cell (D5) to apply the formula.
- Write the formula down-
=C5<="15-05-22"
- Hit Enter and drag down the “fill handle”.
- The dates are compared using a simple formula.
Method 4 – Apply the DATEVALUE Function to Compare If the Date Is Before Another Date
You can also do the same task by applying the DATEVALUE function in Excel. The DATEVALUE function converts a date to a text string as a serial number.
We have a dataset with some dates, just like the following screenshot.
Steps:
- Choose a cell (D5) and then put the following formula down-
=C5<=DATEVALUE("4/15/2022")
- Press Enter and drag down the “fill handle”.
- We successfully compared if the date is before another date utilizing the DATEVALUE function.
Method 5 – Perform the TODAY Function to Compare If the Date Is Before Another Date
Steps:
- Select a cell (D5) to apply the formula-
=C5<=TODAY()
- Cick the Enter button and drag down the “Fill Handle” to fill all the cells.
- We compared the date from the dataset with our current today’s date without any hesitation. As all the dates from the list are before today’s date thus the output is “True” for all the cells.
Method 6 – Combine IF and TODAY Functions to Compare If Date Is Before Another Date
Steps:
- Choose a cell (D5) and apply the following formula down-
=IF(C5<=TODAY(),"Yes","No")
- Hit the Enter button.
- Drag down the “fill handle” to get the final output.
- We reached the destination by comparing the date if it was before another date in Excel.
Things to Remember
- In method 3, after applying the formula, sometimes a “#VALUE!” error may occur. To avoid errors, remember to use quotation marks (“”)at the start and end of the date.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
<< Go Back to Dates | Compare | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!