Function Problems

Check for Dates Within Six Months Before a Date in Excel

Amos GikundaAmos Gikunda Nov 18, 2026 870 views

Question details

Check whether any date in a list falls within the six months before a specified date, excluding the specified date and later dates.

Check for Dates Within Six Months Before a Date in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to compare a list of dates against a specified date and return a Yes or No result.
Observed behavior
The desired result is Yes if at least one date falls within the qualifying range, and No otherwise.
Before you start

Make sure the dates in the list and the comparison cell are recognized as date values rather than text. For the date-only comparison below, remove time portions from the values if necessary.

Solution 1Recommended

Use COUNTIFS and EDATE to check the date range in Excel

Use this formula to return Yes when at least one date is within the six months before the comparison date.

The formula includes the date exactly six calendar months before the comparison date, but excludes the comparison date itself and all later dates.

1
Enter the dates

Enter the dates to check in cells B1:B5 and enter the comparison date in E1.

2
Enter the formula

Select an empty cell, enter =IF(COUNTIFS(B1:B5,">="&EDATE(E1,-6),B1:B5,"<"&E1)>0,"Yes","No"), and press Enter.

3
Review the result

Check the formula cell: Yes means at least one date qualifies; No means none do. Change B1:B5 or E1 in the formula if your data is in different cells.

Use COUNTIFS and EDATE to check the date range in Excel
Dates with times: Excel stores times as fractions of a day. If E1 contains a time, an earlier time on the same date can qualify; use date-only values to exclude the entire comparison date.
Check dates in WPS Spreadsheet

Check a six-month date range in WPS Spreadsheet

Use the same COUNTIFS and EDATE formula in WPS Spreadsheet to check whether any listed date falls within the six months before a comparison date.

  1. 1. Open your spreadsheet: Open WPS Spreadsheet and use Open to select your workbook, or create a new spreadsheet.
  2. 2. Enter the dates: Place the dates to check in B1:B5 and the comparison date in E1.
  3. 3. Add the formula: Select an empty cell and enter =IF(COUNTIFS(B1:B5,">="&EDATE(E1,-6),B1:B5,"<"&E1)>0,"Yes","No").
  4. 4. Check the answer: Press Enter and read Yes or No in the formula cell. Adjust the cell references to match your worksheet.
Check a list of dates with one Yes-or-No formula.Open and save Microsoft Excel XLSX files.Use familiar spreadsheet functions and cell references.
microsoft office alternative - wps office

Frequently Asked Questions

Is the date exactly six months before the comparison date included?

Yes. The >= criterion includes the date returned by EDATE(E1,-6).

Does the formula include the comparison date?

No, when the cells contain date-only values. The <E1 criterion excludes E1 and later dates.

How can I check a longer list of dates?

Replace both instances of B1:B5 in the formula with your actual date range, such as B2:B100.

Why might a date on the comparison day return Yes?

If E1 contains a time, a value earlier on the same day can be less than E1. Remove time portions from the dates and E1 to compare whole dates.