Use an Excel IF Formula to Compare Dates and Inspection Cycles
Question details
Create an IF formula that compares a start date with 25% of an inspection cycle.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The cycle length is in N2, the inspection date is in DC2, and the start date or start year is in L2.
- Observed behavior
- The formula should return TRUE when the cycle exceeds three years and the start date is on or before the calculated cutoff; otherwise, it should return FALSE.
Confirm that N2 contains a numeric cycle length in years and DC2 contains a valid Excel date. Check whether L2 contains a full date or a numeric year, because each requires a different comparison.
Compare a full start date with the cycle cutoff
Use this formula when L2 contains a valid date and the cutoff is 25% of the cycle after the inspection date.
Enter the cycle length in years in N2, the inspection date in DC2, and the start date in L2.
Select the result cell and enter =IF(N2>3,L2<=EDATE(DC2,N2*25%*12),FALSE).
Press Enter. The formula returns TRUE only if N2 is greater than 3 and L2 is on or before the cutoff date.

Compare a numeric start year with the cutoff year
Use a year-only comparison when L2 contains a number such as 2025 rather than a full date.
Compare inspection dates in WPS Spreadsheets
Use IF and EDATE in WPS Spreadsheets to calculate the cycle cutoff and compare it with a start date.
- 1. Open the workbook: Open WPS Spreadsheets and select Open to load your Excel workbook.
- 2. Check the inputs: Enter the cycle length in years in N2, the inspection date in DC2, and the full start date in L2.
- 3. Enter the formula: Select a result cell and enter =IF(N2>3,L2<=EDATE(DC2,N2*25%*12),FALSE).
- 4. Calculate and save: Press Enter to display TRUE or FALSE, then use File > Save or Save As to save the workbook.

Frequently Asked Questions
What does the IF and EDATE formula check?
It checks whether N2 is greater than 3 and whether L2 is on or before the date calculated by adding 25% of the cycle to DC2. If either condition is not met, it returns FALSE.
Why is the cycle multiplied by 12?
N2 is expressed in years, while EDATE takes a number of months. Multiplying N2 by 25% and then by 12 converts the selected portion of the cycle to months.
What happens when the calculated number of months is fractional?
EDATE truncates the fractional part and uses whole months. For example, a value of 10.5 months is treated as 10 months.
How do I compare only the year in L2?
If L2 contains a numeric year, compare it with YEAR(EDATE(DC2,N2*25%*12)). If L2 contains a full date, use YEAR(L2) for a year-only comparison.




