Calculate monthly booked percentage of hotel rooms

arendberg

New Member
Joined
Jan 23, 2024
Messages
21
Office Version
  1. 365
Platform
  1. MacOS
Hey all,

I have a very big Excel file with all our hotel reservations in it. Column A has arrival dates, Column B has departure dates and Column C has the Room name. Every row shows 1 reservation.
In another sheet I would like to show per month the percentage of nights that have been reserved. So I input the Room name in this new sheet in N1 and for every month I will get a percentage showing how many nights have been booked in that month.

So if you take Room 1 for January 2025 you can see that it has been booked for 7 nights. So sheet 2 should show me a percentage of 21.6%. January has 31 possible nights that can be booked, 7 / 31 * 100.

I have tried a lot of things but so far have not been able to get the correct formula.

Hopefully someone here is able to help, thanks in advance!!

Example.xlsx
ABC
1ArrivalDepartureRoom
25/1/245/3/24Room 2
35/1/245/4/24Room 1
45/9/245/20/24Room 2
55/12/245/17/24Room 1
65/27/245/29/24Room 2
76/4/246/7/24Room 2
86/6/246/9/24Room 1
96/7/246/11/24Room 2
106/12/246/16/24Room 2
116/14/246/18/24Room 1
126/20/246/23/24Room 2
136/21/246/23/24Room 1
146/23/246/25/24Room 1
156/23/246/25/24Room 2
166/25/246/30/24Room 1
176/29/248/27/24Room 2
187/5/247/9/24Room 1
197/14/247/19/24Room 1
207/23/247/26/24Room 1
217/29/248/4/24Room 1
228/9/248/12/24Room 1
238/12/248/15/24Room 1
248/16/248/18/24Room 1
258/18/248/22/24Room 1
268/25/248/29/24Room 1
278/29/248/31/24Room 2
288/29/249/1/24Room 1
298/31/249/3/24Room 2
309/3/249/7/24Room 2
319/4/249/6/24Room 1
329/8/249/11/24Room 2
339/16/249/20/24Room 2
349/17/249/22/24Room 1
3510/2/2410/4/24Room 1
3610/2/2410/5/24Room 2
3710/6/2410/7/24Room 1
3810/6/2410/10/24Room 2
3910/13/2410/17/24Room 2
4010/21/2410/25/24Room 2
4110/21/2410/27/24Room 1
4210/29/2411/10/24Room 1
4310/30/2411/1/24Room 2
4411/1/2411/3/24Room 2
4511/4/2411/8/24Room 2
4611/8/2411/10/24Room 2
4711/15/2411/17/24Room 1
4811/20/2411/24/24Room 1
4911/22/2411/24/24Room 2
5011/28/2411/29/24Room 1
5112/5/2412/7/24Room 2
5212/7/2412/9/24Room 1
5312/11/2412/14/24Room 1
5412/14/2412/16/24Room 2
5512/19/2412/22/24Room 2
5612/20/2412/22/24Room 1
5712/23/2412/27/24Room 2
5812/23/2412/27/24Room 1
5912/27/2412/30/24Room 1
6012/27/2412/30/24Room 2
6112/30/241/4/25Room 2
6212/31/241/4/25Room 1
631/17/251/19/25Room 1
641/18/251/25/25Room 2
651/19/251/24/25Room 1
661/25/252/1/25Room 2
672/14/252/21/25Room 2
682/20/252/25/25Room 1
692/21/253/1/25Room 2
703/10/253/15/25Room 1
713/17/253/20/25Room 1
723/17/253/23/25Room 2
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
2:72Expression=#REF!<>""textYES


Example.xlsx
ABCDEFGHIJKLMN
1May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-24Jan-25Feb-25Mar-25Apr-25Room 1
2Formula that shows 22,6%
Sheet2
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try:
Book3
ABCDEFGHIJKLMNOPQR
1ArrivalDepartureRoomRoom 1
25/1/245/3/24Room 25/1/246/1/247/1/248/1/249/1/2410/1/2411/1/2412/1/241/1/252/1/253/1/254/1/25
35/1/245/4/24Room 125.8%53.3%58.1%61.3%23.3%67.7%23.3%58.1%22.6%17.9%25.8%0.0%
45/9/245/20/24Room 2
55/12/245/17/24Room 1
65/27/245/29/24Room 2
76/4/246/7/24Room 2
86/6/246/9/24Room 1
96/7/246/11/24Room 2
106/12/246/16/24Room 2
116/14/246/18/24Room 1
126/20/246/23/24Room 2
136/21/246/23/24Room 1
146/23/246/25/24Room 1
156/23/246/25/24Room 2
166/25/246/30/24Room 1
176/29/248/27/24Room 2
187/5/247/9/24Room 1
197/14/247/19/24Room 1
207/23/247/26/24Room 1
217/29/248/4/24Room 1
228/9/248/12/24Room 1
238/12/248/15/24Room 1
248/16/248/18/24Room 1
258/18/248/22/24Room 1
268/25/248/29/24Room 1
278/29/248/31/24Room 2
288/29/249/1/24Room 1
298/31/249/3/24Room 2
309/3/249/7/24Room 2
319/4/249/6/24Room 1
329/8/249/11/24Room 2
339/16/249/20/24Room 2
349/17/249/22/24Room 1
3510/2/2410/4/24Room 1
3610/2/2410/5/24Room 2
3710/6/2410/7/24Room 1
3810/6/2410/10/24Room 2
3910/13/2410/17/24Room 2
4010/21/2410/25/24Room 2
4110/21/2410/27/24Room 1
4210/29/2411/10/24Room 1
4310/30/2411/1/24Room 2
4411/1/2411/3/24Room 2
4511/4/2411/8/24Room 2
4611/8/2411/10/24Room 2
4711/15/2411/17/24Room 1
4811/20/2411/24/24Room 1
4911/22/2411/24/24Room 2
5011/28/2411/29/24Room 1
5112/5/2412/7/24Room 2
5212/7/2412/9/24Room 1
5312/11/2412/14/24Room 1
5412/14/2412/16/24Room 2
5512/19/2412/22/24Room 2
5612/20/2412/22/24Room 1
5712/23/2412/27/24Room 2
5812/23/2412/27/24Room 1
5912/27/2412/30/24Room 1
6012/27/2412/30/24Room 2
6112/30/241/4/25Room 2
6212/31/241/4/25Room 1
631/17/251/19/25Room 1
641/18/251/25/25Room 2
651/19/251/24/25Room 1
661/25/252/1/25Room 2
672/14/252/21/25Room 2
682/20/252/25/25Room 1
692/21/253/1/25Room 2
703/10/253/15/25Room 1
713/17/253/20/25Room 1
723/17/253/23/25Room 2
Sheet8
Cell Formulas
RangeFormula
E3:P3E3=SUM(FILTER($B$2:$B$72-$A$2:$A$72,($C$2:$C$72=$R$1)*(EOMONTH(+$A$2:$A$72,-1)+1=E2),0))/DAY(EOMONTH(E2,0))
 
Upvote 0
You are amazing!! I think this is nearly it. Can you please check what is wrong with June 24 for Room 2? It shows 250%?
I think it has something to do with the fact that it has a reservation with arrival on 29-06 and departure on 27-08. The formula incorrectly is taking all those days while it should only calculate the days in June?
 
Upvote 0
How about this?
Book3
ABCDEFGHIJKLMNOPQR
1ArrivalDepartureRoomRoom 2
25/1/245/3/24Room 25/1/246/1/247/1/248/1/249/1/2410/1/2411/1/2412/1/241/1/252/1/253/1/254/1/25
35/1/245/4/24Room 148.4%56.7%0.0%6.5%36.7%51.6%33.3%48.4%41.9%50.0%19.4%0.0%
45/9/245/20/24Room 2
55/12/245/17/24Room 1
65/27/245/29/24Room 2
76/4/246/7/24Room 2
86/6/246/9/24Room 1
96/7/246/11/24Room 2
106/12/246/16/24Room 2
116/14/246/18/24Room 1
126/20/246/23/24Room 2
136/21/246/23/24Room 1
146/23/246/25/24Room 1
156/23/246/25/24Room 2
166/25/246/30/24Room 1
176/29/248/27/24Room 2
187/5/247/9/24Room 1
197/14/247/19/24Room 1
207/23/247/26/24Room 1
217/29/248/4/24Room 1
228/9/248/12/24Room 1
238/12/248/15/24Room 1
248/16/248/18/24Room 1
258/18/248/22/24Room 1
268/25/248/29/24Room 1
278/29/248/31/24Room 2
288/29/249/1/24Room 1
298/31/249/3/24Room 2
309/3/249/7/24Room 2
319/4/249/6/24Room 1
329/8/249/11/24Room 2
339/16/249/20/24Room 2
349/17/249/22/24Room 1
3510/2/2410/4/24Room 1
3610/2/2410/5/24Room 2
3710/6/2410/7/24Room 1
3810/6/2410/10/24Room 2
3910/13/2410/17/24Room 2
4010/21/2410/25/24Room 2
4110/21/2410/27/24Room 1
4210/29/2411/10/24Room 1
4310/30/2411/1/24Room 2
4411/1/2411/3/24Room 2
4511/4/2411/8/24Room 2
4611/8/2411/10/24Room 2
4711/15/2411/17/24Room 1
4811/20/2411/24/24Room 1
4911/22/2411/24/24Room 2
5011/28/2411/29/24Room 1
5112/5/2412/7/24Room 2
5212/7/2412/9/24Room 1
5312/11/2412/14/24Room 1
5412/14/2412/16/24Room 2
5512/19/2412/22/24Room 2
5612/20/2412/22/24Room 1
5712/23/2412/27/24Room 2
5812/23/2412/27/24Room 1
5912/27/2412/30/24Room 1
6012/27/2412/30/24Room 2
6112/30/241/4/25Room 2
6212/31/241/4/25Room 1
631/17/251/19/25Room 1
641/18/251/25/25Room 2
651/19/251/24/25Room 1
661/25/252/1/25Room 2
672/14/252/21/25Room 2
682/20/252/25/25Room 1
692/21/253/1/25Room 2
703/10/253/15/25Room 1
713/17/253/20/25Room 1
723/17/253/23/25Room 2
Sheet8
Cell Formulas
RangeFormula
E3:P3E3=LET( arrival,$A$2:$A$72, depart,$B$2:$B$72, room,E2, SUM(FILTER(IF(depart>EOMONTH(+arrival,0),EOMONTH(+arrival,0),depart)-arrival,($C$2:$C$72=$R$1)*(EOMONTH(+arrival,-1)+1=room),0))/DAY(EOMONTH(room,0)) )
 
Upvote 0
Ah yes I think now it is correct, thank you so much!

One last thing I just though of. We also put our cancellations in this sheet. These should not count of course. Can you adjust your formula that when there is a date present in Column D it doesn't count the nights in that row?

Example.xlsx
ABCD
1ArrivalDepartureRoomCancelled
25/1/245/3/24Room 22/1/24
35/1/245/4/24Room 1
45/9/245/20/24Room 2
55/12/245/17/24Room 1
65/27/245/29/24Room 2
76/4/246/7/24Room 2
86/6/246/9/24Room 1
96/7/246/11/24Room 2
106/12/246/16/24Room 24/10/24
116/14/246/18/24Room 1
126/20/246/23/24Room 2
136/21/246/23/24Room 1
146/23/246/25/24Room 1
156/23/246/25/24Room 2
166/25/246/30/24Room 1
176/29/248/27/24Room 2
187/5/247/9/24Room 1
197/14/247/19/24Room 1
207/23/247/26/24Room 1
217/29/248/4/24Room 1
228/9/248/12/24Room 1
238/12/248/15/24Room 17/20/24
248/16/248/18/24Room 1
258/18/248/22/24Room 1
268/25/248/29/24Room 1
278/29/248/31/24Room 2
288/29/249/1/24Room 1
298/31/249/3/24Room 2
309/3/249/7/24Room 2
319/4/249/6/24Room 1
329/8/249/11/24Room 2
339/16/249/20/24Room 2
349/17/249/22/24Room 1
3510/2/2410/4/24Room 1
3610/2/2410/5/24Room 2
3710/6/2410/7/24Room 1
3810/6/2410/10/24Room 2
3910/13/2410/17/24Room 2
4010/21/2410/25/24Room 2
4110/21/2410/27/24Room 1
4210/29/2411/10/24Room 1
4310/30/2411/1/24Room 2
4411/1/2411/3/24Room 2
4511/4/2411/8/24Room 2
4611/8/2411/10/24Room 2
4711/15/2411/17/24Room 1
4811/20/2411/24/24Room 1
4911/22/2411/24/24Room 2
5011/28/2411/29/24Room 1
5112/5/2412/7/24Room 2
5212/7/2412/9/24Room 1
5312/11/2412/14/24Room 1
5412/14/2412/16/24Room 2
5512/19/2412/22/24Room 2
5612/20/2412/22/24Room 1
5712/23/2412/27/24Room 2
5812/23/2412/27/24Room 1
5912/27/2412/30/24Room 1
6012/27/2412/30/24Room 2
6112/30/241/4/25Room 2
6212/31/241/4/25Room 1
631/17/251/19/25Room 1
641/18/251/25/25Room 2
651/19/251/24/25Room 1
661/25/252/1/25Room 2
672/14/252/21/25Room 2
682/20/252/25/25Room 1
692/21/253/1/25Room 2
703/10/253/15/25Room 1
713/17/253/20/25Room 1
723/17/253/23/25Room 2
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
2:72Expression=#REF!<>""textYES
 
Upvote 0
Try:
Excel Formula:
=LET(
arrival,$A$2:$A$72,
depart,$B$2:$B$72,
SUM(FILTER(IF(depart>EOMONTH(+arrival,0),EOMONTH(+arrival,0),depart)-arrival,($C$2:$C$72=$S$1)*(EOMONTH(+arrival,-1)+1=F2)*($D$2:$D$72=""),0))/DAY(EOMONTH(F2,0))
)
 
Upvote 0
Sorry, I was to quick :)

I have now put the formula in the big sheet with over 2000 rows of data and I see that not all of them calculate correctly. Especially months that are 100% are not showing as 100%?

Take this as an example, this room has 28 nights booked in February 2025 but your formula shows it as 96.4%?

Example.xlsx
ABCD
1ArrivalDepartureRoomCancelled
22/1/252/8/25Room 1
32/8/252/15/25Room 1
42/15/252/22/25Room 1
52/22/253/1/25Room 1
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
6:72,C2:XFD5Expression=#REF!<>""textYES
 
Upvote 0
Because row 5 is only 6 days i.e. 2/22/25 to 2/28/25. It's excluding 3/1/25 as you requested in post #3.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top