The trip is June 6 through June 20, 2026. Both of those dates are Saturdays. The room is a separate pair of dates inside that window. The workbook for a longer event list is the event budget.
The three lines
=SUMIFS(C2:C4,B2:B4,"Stay")| A | B | C | |
|---|---|---|---|
| 1 | Item | Category | Amount |
| 2 | Flights | Travel | $600 |
| 3 | Room | Stay | $840 |
| 4 | Food | Meals | $560 |
| 5 | Stay | $840 | |
| 6 | Trip | $2,000 |
SUMIFS of the category Stay is $840. SUM of the three amounts is 600 + 840 + 560 = 2,000. A category typed as stay does not match Stay.
Nights are not inclusive days
The nightly rate is the Pier Room’s $140 from the occupancy page. This trip is not that January stay. Six nights at $140 are $840.
=B2-B1| A | B | |
|---|---|---|
| 1 | Check in | 6/10/2026 |
| 2 | Check out | 6/16/2026 |
| 3 | Nights | 6 |
| 4 | Cost | $840 |
June 16 minus June 10 is 6. That is the number of nights when checkout is the morning of the 16th. You do not add 1. The nights are the 10th, 11th, 12th, 13th, 14th, and 15th.
The +1 is for calendar days
xl.overlap.days counts calendar days in both ranges, including both ends. The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA. The subtraction in the picture is the same math.
=MAX(0,MIN(B2,B4)-MAX(B1,B3)+1)| A | B | |
|---|---|---|
| 1 | Start 1 | 1/1/2026 |
| 2 | End 1 | 1/10/2026 |
| 3 | Start 2 | 1/8/2026 |
| 4 | End 2 | 1/15/2026 |
| 5 | Shared days | 3 |
January 8, 9, and 10 are the three shared days. Forgetting the +1 reports 2.
The same +1 on the room dates, treated as inclusive calendar days from June 10 through June 16, is 7. The hotel bill is 6 nights, not those 7 calendar days. Use the night count for the $840. Use the overlap count when you need to know which dates sit inside two ranges, such as the trip window and someone else’s visit. Ranges that miss return 0, not a negative.