Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Highlight Overlapping Dates: How To

· 4 min read · Home Tech

In this article
  1. What Counts as an Overlap
  2. Setting Up the Conditional Formatting Rule
  3. How the Formula Works
  4. Common Variations and Adjustments
  5. Why You Might See False Positives
  6. Alternative: Using a Helper Column
  7. Frequently Asked Questions

Yes, you can highlight overlapping dates in Excel using conditional formatting with a formula. The formula checks each date range against all others and flags any row whose start and end dates overlap with another row's range.

What Counts as an Overlap

Two date ranges overlap when one starts before the other ends and ends after the other starts. For ranges A (startA–endA) and B (startB–endB), the standard condition is:

startA <= endB AND endA >= startB

This includes touching ranges (where one ends exactly when the other starts) as overlaps. If you want to exclude touching, use strict inequalities (< and >).

Setting Up the Conditional Formatting Rule

Assume your data has headers in row 1, with start dates in column A and end dates in column B, for rows 2 through 100. To highlight any row whose date range overlaps with any other row:

  1. Select the range A2:B100 (or just A2:A100 if you only want to highlight the start cell).
  2. Go to Home → Conditional Formatting → New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Enter this formula (adjusting the range to match your data):
    =SUMPRODUCT(($A$2:$A$100<=B2)*(B2>=$A$2:$A$100)*($B$2:$B$100>=A2)*(A2<=$B$2:$B$100))>1
  5. Click Format, pick a fill color, and click OK twice.

The SUMPRODUCT counts how many rows satisfy the overlap condition with the current row. If the count is greater than 1, the row overlaps with at least one other row (the count includes itself).

How the Formula Works

The formula compares the current row’s start (A2) and end (B2) against every row in the range. Each of the four comparisons returns TRUE or FALSE, and multiplying them together yields 1 only when all four are TRUE (i.e., an overlap exists). SUMPRODUCT adds those 1s across all rows, giving the total number of overlapping ranges, including the row itself. So a result of 1 means no overlap; 2 or more means at least one other range overlaps.

This approach works because conditional formatting formulas are evaluated relative to the active cell in the selection. When you select A2:B100, the formula uses relative references (A2, B2) that adjust for each row, while the absolute references ($A$2:$A$100, etc.) stay fixed.

Common Variations and Adjustments

You may want to modify the formula for specific scenarios:

  • Exclude touching ranges: Replace <= with < and >= with > in the formula.
  • Highlight only the start cell: Apply the rule to column A only, using the same formula but selecting A2:A100.
  • Highlight entire row: Select the whole data range (e.g., A2:C100) and use the same formula; the formatting will apply to all cells in the row.
  • Ignore blank rows: Add a condition to skip rows with no dates, e.g., =AND(COUNT(A2:B2)=2, SUMPRODUCT(...)>1).

Why You Might See False Positives

A common mistake is using a formula that compares only the current row to the row above or below, like =AND(A2<=B1, B2>=A1). That only checks adjacent rows and misses overlaps with non-adjacent rows. The SUMPRODUCT method checks all rows, so it catches every overlap.

Another issue is not locking the range with absolute references. If you forget the dollar signs, the range shifts as the formula applies to each cell, producing incorrect results.

Alternative: Using a Helper Column

If you prefer a non-formula approach or need to see the count of overlaps, add a helper column with this formula in row 2:

=SUMPRODUCT(($A$2:$A$100<=B2)*($B$2:$B$100>=A2))-1

This returns the number of other rows that overlap with the current row. Then you can filter or sort by that column, or use conditional formatting on it (e.g., highlight values greater than 0).

Frequently Asked Questions

How do I highlight overlapping dates in Excel without using conditional formatting?

You can use a helper column with the SUMPRODUCT formula above to count overlaps, then manually filter or sort. Alternatively, use Excel’s Remove Duplicates if you only need to find identical ranges, but that won’t catch partial overlaps.

Why is my conditional formatting not working for overlapping dates?

Check that your range references are correct. The formula must use absolute references for the entire range (e.g., $A$2:$A$100) and relative references for the current row (A2, B2). Also ensure the selected range matches the formula’s starting row. If you select A2:B100, the formula should reference row 2, not row 1.

Can I highlight overlapping dates across different sheets?

Conditional formatting formulas can reference other sheets, but the syntax is more complex and may require named ranges. It’s usually easier to combine the data into one sheet or use a helper column that pulls data from other sheets.

Does this method work in Google Sheets?

Yes, the same SUMPRODUCT formula works in Google Sheets. The conditional formatting interface is similar: select the range, choose Custom formula is, and enter the same formula.

How do I highlight overlapping dates for a specific category (e.g., only for a certain project)?

Add a condition to the formula that checks the category column. For example, if column C contains project names, add ($C$2:$C$100=$C2) to the SUMPRODUCT. This ensures only rows with the same category are compared.

What if my dates include times?

Excel stores dates and times as numbers, so the formula works the same. Just ensure your start and end cells contain both date and time values, and the comparison will include the time component.