How to Check for Overlapping Date Ranges in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
Two date ranges overlap when each one starts on or before the day the other ends: =AND(Start1<=End2,Start2<=End1). To check a whole list, use COUNTIFS to count rows whose start is on or before this row's end and whose end is on or after this row's start, then subtract 1 for the row itself. Any result above 0 is an overlap.
Key takeaways
- Ranges overlap when Start1 <= End2 and Start2 <= End1. You only need these two comparisons.
- In a list, =COUNTIFS(starts,"<="&C2,ends,">="&B2)-1 counts how many other rows clash with row 2.
- Add a criteria pair, such as the employee or room, to check overlaps only within the same group.
- Overlapping days = MAX(0, MIN(End1,End2) − MAX(Start1,Start2) + 1).
- Decide whether touching ranges count. For hotel-style bookings, use < and > instead of <= and >=.
On this page+
To check for overlapping date ranges in Excel, compare each range's start with the other's end. Two ranges overlap when each one starts on or before the day the other one ends, which is one short AND formula for a pair and one COUNTIFS formula for a whole list. This guide is for anyone who manages leave, bookings, shifts or project dates and needs to spot clashes before they cause trouble.
The rule for overlapping date ranges#
Two date ranges overlap when Start1 <= End2 and Start2 <= End1. Both must be true.
It is easier to see why by thinking about when ranges don't overlap. There are only two ways:
- Range 1 ends before range 2 starts (End1 < Start2), or
- Range 2 ends before range 1 starts (End2 < Start1).
If neither of these is true, the ranges share at least one day. Turning those two "no overlap" cases around gives the rule above. You don't need to check whether one range sits inside the other, because the rule already covers it.
All examples use this leave list in A1:C7:
| A | B | C | |
|---|---|---|---|
| 1 | Employee | Start | End |
| 2 | Ana | Mon 6 Jul 2026 | Fri 10 Jul 2026 |
| 3 | Ben | Wed 8 Jul 2026 | Thu 9 Jul 2026 |
| 4 | Ana | Thu 9 Jul 2026 | Tue 14 Jul 2026 |
| 5 | Chris | Mon 13 Jul 2026 | Fri 17 Jul 2026 |
| 6 | Ben | Mon 20 Jul 2026 | Fri 24 Jul 2026 |
| 7 | Chris | Fri 17 Jul 2026 | Tue 21 Jul 2026 |
The dates must be real Excel dates, not text. Excel stores a date as a number, which is why <= and >= work on them.
Check if two date ranges overlap with AND#
To compare two rows, put both comparisons inside AND:
=AND(B2<=C4,B4<=C2)This compares Ana's two leave periods. 6 Jul is on or before 14 Jul, and 9 Jul is on or before 10 Jul, so the result is TRUE. The AND function guide explains how AND returns TRUE only when every test is true, and the guide to AND, OR and NOT shows more examples.
Wrap it in IF for a friendlier label:
=IF(AND(B2<=C4,B4<=C2),"Overlap","OK")Find every overlap in a list with COUNTIFS#
To check a whole list, count how many rows clash with each row. In D2, type:
=COUNTIFS($B$2:$B$7,"<="&C2,$C$2:$C$7,">="&B2)-1Fill it down to D7 (Windows: Ctrl+D; Mac: ⌘D). Here is what each part does:
$B$2:$B$7,"<="&C2keeps rows that start on or before this row's end.$C$2:$C$7,">="&B2keeps rows that end on or after this row's start.-1removes the row itself, because every range overlaps itself.
The & joins the operator to the date in the cell. Writing "<=C2" would compare against the text "C2" and return the wrong count. The COUNTIFS function guide covers this pattern, and COUNTIFS with a date range shows more date criteria.
For row 2, the result is 2: Ben's 8–9 Jul and Ana's own 9–14 Jul both overlap Ana's 6–10 Jul. That is a team view: it shows who is away at the same time.
Check overlaps for the same person or room only#
Often you only care about clashes within one group, such as the same employee or the same meeting room. Add a criteria pair for the group:
=COUNTIFS($A$2:$A$7,A2,$B$2:$B$7,"<="&C2,$C$2:$C$7,">="&B2)-1Now row 2 returns 1: only Ana's second period clashes with her first. Filled down, the results are 1, 0, 1, 1, 0, 1. Ana has a double-booked request, and so does Chris, whose two periods both include 17 Jul.
To show a clear flag, wrap it: =IF(COUNTIFS(...)-1>0,"Clash",""). This is the check a leave tracker or an appointment tracker needs before a new booking is approved.
Count the overlapping days#
To know how many days two ranges share, take the later start and the earlier end:
=MAX(0,MIN(C2,C4)-MAX(B2,B4)+1)For Ana's two periods, MIN(10 Jul, 14 Jul) is 10 Jul and MAX(6 Jul, 9 Jul) is 9 Jul. The difference is 1, plus 1 to count both days, so the result is 2 days (9 and 10 Jul). If the ranges don't overlap, the subtraction is negative and MAX(0,…) returns 0.
The same idea counts how many days of one range fall inside a fixed period, such as a month. If G1 holds 1 Jul 2026 and G2 holds 31 Jul 2026, then =MAX(0,MIN(C2,$G$2)-MAX(B2,$G$1)+1) returns the July days in each leave request. For working days only, use =NETWORKDAYS(MAX(B2,B4),MIN(C2,C4)), which returns 2 here too. Wrap it in MAX(0,…) because NETWORKDAYS returns a negative number when there is no overlap.
Should touching ranges count as an overlap?#
With <= and >=, ranges that touch on one day count as overlapping. Chris's leave ends on 17 Jul and his next request starts on 17 Jul, so they overlap by one day.
That is right for leave, where both requests include 17 Jul. It is wrong for hotel rooms or equipment hire, where one guest checks out on the morning another checks in. For those, use strict comparisons:
=COUNTIFS($A$2:$A$7,A2,$B$2:$B$7,"<"&C2,$C$2:$C$7,">"&B2)-1Be careful with the -1 here. With strict comparisons, a one-day booking (same start and end) doesn't match itself, so the self-count is lost. If your list has same-day bookings, count them separately or keep the inclusive version.
Common mistakes with overlapping dates#
These cause most wrong results:
- Dates stored as text. A date typed as text won't compare correctly. Check with
=ISNUMBER(B2), which should return TRUE. - Forgetting the -1. Every row overlaps itself, so without it every row shows at least 1.
- Ranges not locked. Without
$, the ranges shift as you fill down and miss rows. - End before start. A typo like 14 Jun instead of 14 Jul breaks every check. Add a test such as
=C2>=B2. - Dates with times. If cells hold times as well as dates, an end of 10 Jul 09:00 is earlier than 10 Jul 17:00. Strip times with INT if you only care about days.
The IF with dates guide has more ways to compare dates safely.
Practise it#
Try the exercise on this page to find Ana's clash with COUNTIFS. Then practise dates in criteria in a live spreadsheet, where you count and total rows between two dates, and build multi-condition checks in the COUNTIFS and SUMIFS lesson. Each lesson checks your formula instantly.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Does Ana's first leave (row 2) clash with any of her other leave? In E2, use COUNTIFS to count rows for the same employee (A2) whose start is on or before C2 and whose end is on or after B2, then subtract 1. Press Enter.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | End | Clashes | ||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 | ||||||
| 9 | ||||||
| 10 |
Tip: Three pairs: the employee column with A2, the start column with "<="&C2, and the end column with ">="&B2. Then subtract 1 so the row doesn't count itself.
Practise this in a lesson
Frequently asked questions
How do I check if two date ranges overlap in Excel?
Use =AND(B2<=C3,B3<=C2), where B is the start date and C is the end date. It returns TRUE if the ranges share at least one day and FALSE if they don't.
How do I find overlapping dates in a list?
In a helper column, use =COUNTIFS($B$2:$B$7,"<="&C2,$C$2:$C$7,">="&B2)-1 and fill it down. Any row with a result above 0 overlaps at least one other row.
How do I count the number of overlapping days?
Use =MAX(0,MIN(C2,C3)-MAX(B2,B3)+1). The later start and the earlier end mark the shared period. MAX(0,...) returns 0 when there is no overlap instead of a negative number.
Do ranges that touch count as overlapping?
With <= and >=, a range ending on 17 July and one starting on 17 July overlap by one day. For bookings where checkout and check-in can share a day, use < and > so touching ranges don't count.
How do I highlight overlapping dates in Excel?
Select the rows, choose Home > Conditional Formatting > New Rule > Use a formula, and enter the COUNTIFS check with >0 at the end, using locked ranges and the first row's cells. Pick a fill colour and click OK.