I have a home rental business, I wish to calculate the occupancy rate. For that, I need to calculate the number of nights in a specific month between 2 dates (check-in and check-out).
Here's an example:
A B C D E F
1 | IN | OUT | NIGHTS | 01/01/18 | 01/02/18 |...
------------------------------------------------------------
2 | 15/01/18 | 25/01/18 | 10 | 10 | 0 |...
------------------------------------------------------------
3 | 28/01/18 | 04/02/18 | 7 | 3 | 3 |...
Here are the formulas for:
C3 = B3-A3
D3 = MAX(0; MIN(EOMONTH(D$1;0); $B3) - MAX(D$1; $A3))
I think I'm not too far but the formula is still incorrect. As you can see, D2 is correct, but D3 is wrong. This is the tricky part, when the stays overlaps on 2 months, Jan and Feb in thisi case. D3 should show 4 nights and not 3.
Anyone can help please? Thanks in advance!
PS: sorry for the formatting but I am not able to add a screenshot..
28/01/18and01/01/18? - Chef1075