Two bookings, two projects, two leave requests — how many days do they overlap? A neat MIN/MAX trick finds the shared span without any nested IFs.
The example
Two stays that partly overlap.
| A | B | C | |
|---|---|---|---|
| 1 | Range | Start | End |
| 2 | A | 6/1/2026 | 6/10/2026 |
| 3 | B | 6/7/2026 | 6/15/2026 |
| 4 | Overlap days | 4 | (Jun 7-10) |
The formula
Days the two ranges share:
How it works
The overlap is bounded by the latest start and the earliest end:
- The overlap can’t start before either range does, so its start is
MAX(B1,B2)— the later of the two starts. - It can’t end after either range ends, so its end is
MIN(C1,C2)— the earlier of the two ends. - Subtract and add 1 (both endpoints count) to get the day count:
MIN(C1,C2) - MAX(B1,B2) + 1. - If the ranges don’t touch, that result goes negative —
MAX(0, …)clamps it to 0.
Do they overlap at all? Wrap it in a test: =IF(MAX(0,MIN(C1,C2)-MAX(B1,B2)+1)>0, "Overlap", "No overlap"). Drop the +1 if you want the gap in nights rather than inclusive days.
Try it: interactive demo
Set two date ranges.
Variations
Do they overlap?
Yes/no flag:
Nights instead of days
Drop the +1:
Gap when they don’t overlap
Days between the ranges:
Pitfalls & errors
The +1 sets inclusivity. With +1 both endpoints count (calendar days); without it you get nights/full intervals. Pick the one your context needs.
Don’t skip MAX(0,…). Without it, non-overlapping ranges return a misleading negative number instead of 0.
Ends must be ≥ starts. The trick assumes each range’s end is on or after its start. Validate inputs if users might enter them backwards.
Practice workbook
Frequently asked questions
How do I calculate overlapping days between two date ranges in Excel?
Why is there a +1 in the formula?
How do I just check whether two ranges overlap?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class