logo
search
Formula Errors

How to Check if a Date is Within Three Years in Excel

Ayan MasoodAyan Masood Oct 14, 2026 870 views

Question details

The user needs an Excel formula to determine if a specific date falls within a three-year range of a reference date or fiscal year, returning a Yes or No result.

How to Check if a Date is Within Three Years in Excel
Product
Excel
Device & OS
not provided
Scenario
Comparing dates or fiscal periods to automate a YES/NO output based on whether the target date falls within a 36-month window of a specified reference date.
Observed behavior
The goal state is an automated spreadsheet where target dates are correctly evaluated against a three-year timeframe or custom fiscal year ending on September 30.
Before you start

Ensure your date cells are properly formatted as Dates in your spreadsheet. Identify the cell containing your static reference date (e.g., A2) and the cell containing the target date you want to check (e.g., B2).

Solution 1Recommended

Use the EDATE and IF Functions for 36-Month Comparisons

The EDATE function calculates the exact date 36 months in the past, making it the most accurate method for standard date comparisons over a three-year period.

This approach uses EDATE to subtract exactly 36 months from your reference date, then uses the IF function to evaluate whether the target date is greater than or equal to that resulting date.

1
Select the target cell

Click on the empty cell where you want the YES or NO result to appear (for example, cell D2).

2
Enter the EDATE formula

Type the formula =IF(EDATE($A$2,-36)<=B2,"YES","NO") into the formula bar. Replace $A$2 with your fixed reference date cell and B2 with the date you are checking.

3
Apply and fill down

Press Enter on your keyboard to calculate the result. Click and drag the small square handle at the bottom-right corner of the cell to copy the formula down for your entire dataset.

Use the EDATE and IF Functions for 36-Month Comparisons
Using Absolute References: Adding dollar signs ($A$2) creates an absolute reference, ensuring the reference date cell doesn't shift when you copy the formula to other rows.
Advanced Formula Support

Calculate Complex Dates Easily with WPS Spreadsheet

WPS Spreadsheet provides full support for advanced date and logical functions including EDATE, IF, and AND. You can seamlessly manage fiscal year comparisons and automate your data workflows in a familiar, user-friendly interface.

  1. 1. Open your dataset in WPS: Launch WPS Spreadsheet and open the workbook containing your dates.
  2. 2. Apply the date formatting: Select your date columns, right-click, choose 'Format Cells', and ensure 'Date' format is applied.
  3. 3. Input the formula: Click the cell for your output and type =IF(EDATE($A$2,-36)<=B2,"YES","NO").
  4. 4. Calculate your results: Press Enter to execute the formula, then drag the fill handle to apply it across all rows.
Fully compatible with Microsoft Excel formulas and date functions, ensuring zero errors.Lightweight architecture that runs smoothly on Windows, Mac, and Linux.Intuitive user interface for easy formula creation and complex data analysis.Completely free to use for essential spreadsheet management.
microsoft office alternative - wps office

Frequently Asked Questions

What does the EDATE function do in Excel formulas?

The EDATE function returns the serial number of a date that is a specific number of months before or after a starting date. For example, EDATE(A2, -36) calculates the exact date 36 months prior to the date in cell A2.

How do I check if a date is within exactly one year instead of three?

You can easily adjust the months parameter in the EDATE function. To check if a date is within one year (12 months), change the -36 in your formula to -12, making it =IF(EDATE($A$2,-12)<=B2,"YES","NO").

Why is my EDATE formula returning a strange number like 44000 instead of a date?

Spreadsheet software stores dates as sequential serial numbers for calculation purposes. If you see a raw number instead of a date, select the cell, navigate to the Home tab, and change the Number Format dropdown from 'General' to 'Short Date'.