Calculate Occupancy using Arrival and Last Night

bastacks

New Member
Joined
Jul 12, 2017
Messages
3
I'm having trouble when calculating the nightly hotel occupancy using the arrival date and last night stayed.

Column A: Calendar dates (12/31/16. 1/1/17, etc)
Column B: Blank, no data
Column C: Arrival
Column D: Last night

The formula I was given is below, but the results are always 0 (zero). What am I doing wrong?

=COUNTIF($C$3:$C$9999,"<="&$A3)-COUNTIF($D$3:$D$9999,"<="&$A3)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Welcome to the Forum!

Is this what you're looking for?

B14: =COUNTIFS(C$2:C$11,"<="&A14,D$2:D$11,">="&A14)


Excel 2010
ABCD
1ArriveLast night
210 Jul 201712 Jul 2017
310 Jul 201713 Jul 2017
411 Jul 201711 Jul 2017
511 Jul 201712 Jul 2017
611 Jul 201715 Jul 2017
712 Jul 201712 Jul 2017
812 Jul 201713 Jul 2017
912 Jul 201715 Jul 2017
1013 Jul 201713 Jul 2017
1113 Jul 201716 Jul 2017
12
13Date to checkOccupancy
1412 Jul 20177
1513 Jul 20176
1614 Jul 20173
Sheet1
 
Upvote 0
Thanks, but I'm still getting a "0" result.
Formula in B3=
=COUNTIFS(C$2:C$50,"<="&A3,D$2:D$50,">="&A3)


ABCDE
DateArrivalsLast NightDeparture
12/31/2016011/30/201612/31/20161/1/2017
1/1/2017012/1/201612/31/20161/1/2017
1/2/2017012/1/201612/31/20161/1/2017
1/3/2017012/1/201612/31/20161/1/2017
1/4/2017012/1/201612/31/20161/1/2017
1/5/2017012/1/201612/31/20161/1/2017
1/6/2017012/1/201612/31/20161/1/2017
1/7/2017012/1/201612/31/20161/1/2017
1/8/2017012/1/201612/31/20161/1/2017
1/9/2017012/1/201612/31/20161/1/2017
1/10/2017012/1/201612/31/20161/1/2017
1/11/2017012/1/201612/31/20161/1/2017
1/12/2017012/1/201612/31/20161/1/2017
1/13/2017012/1/201612/31/20161/1/2017
1/14/2017012/1/201612/31/20161/1/2017
1/15/2017012/1/201612/31/20161/1/2017
1/16/2017012/1/201612/31/20161/1/2017
1/17/2017012/1/201612/31/20161/1/2017
1/18/2017012/22/201612/31/20161/1/2017
1/19/2017012/25/201612/31/20161/1/2017
1/20/2017012/26/20161/1/20171/2/2017
1/21/2017012/26/20161/1/20171/2/2017
1/22/2017012/26/20161/1/20171/2/2017
1/23/2017012/28/201612/31/20161/1/2017
1/24/2017012/28/201612/31/20161/1/2017
1/25/2017012/28/201612/31/20161/1/2017
1/26/2017012/29/201612/31/20161/1/2017
1/27/2017012/29/201612/31/20161/1/2017
1/28/2017012/29/20161/1/20171/2/2017
1/29/2017012/29/20161/31/20172/1/2017
1/30/2017012/30/201612/31/20161/1/2017
1/31/2017012/30/201612/31/20161/1/2017

<colgroup><col><col><col span="2"><col></colgroup><tbody>
</tbody>
 
Upvote 0
I'm getting a 0 result

B2: =COUNTIFS(C$2:C$50,"<="&A2,D$2:D$50,">="&A2)

DateOccupied UnitsArrivalsLast NightDeparture
12/31/2016011/30/201612/31/20161/1/2017
1/1/2017012/1/201612/31/20161/1/2017
1/2/2017012/1/201612/31/20161/1/2017
1/3/2017012/1/201612/31/20161/1/2017
1/4/2017012/1/201612/31/20161/1/2017
1/5/2017012/1/201612/31/20161/1/2017
1/6/2017012/1/201612/31/20161/1/2017
1/7/2017012/1/201612/31/20161/1/2017
1/8/2017012/1/201612/31/20161/1/2017
1/9/2017012/1/201612/31/20161/1/2017
1/10/2017012/1/201612/31/20161/1/2017
1/11/2017012/1/201612/31/20161/1/2017
1/12/2017012/1/201612/31/20161/1/2017
1/13/2017012/1/201612/31/20161/1/2017
1/14/2017012/1/201612/31/20161/1/2017
1/15/2017012/1/201612/31/20161/1/2017
1/16/2017012/1/201612/31/20161/1/2017
1/17/2017012/1/201612/31/20161/1/2017
1/18/2017012/22/201612/31/20161/1/2017
1/19/2017012/25/201612/31/20161/1/2017
1/20/2017012/26/20161/1/20171/2/2017
1/21/2017012/26/20161/1/20171/2/2017
1/22/2017012/26/20161/1/20171/2/2017
1/23/2017012/28/201612/31/20161/1/2017
1/24/2017012/28/201612/31/20161/1/2017
1/25/2017012/28/201612/31/20161/1/2017
1/26/2017012/29/201612/31/20161/1/2017
1/27/2017012/29/201612/31/20161/1/2017
1/28/2017012/29/20161/1/20171/2/2017
1/29/2017012/29/20161/31/20172/1/2017
1/30/2017012/30/201612/31/20161/1/2017
1/31/2017012/30/201612/31/20161/1/2017
2/1/2017012/30/201612/31/20161/1/2017
2/2/2017012/30/201612/31/20161/1/2017
2/3/2017012/30/20161/1/20171/2/2017
2/4/2017012/30/20161/1/20171/2/2017
2/5/2017012/31/20161/2/20171/3/2017
2/6/2017012/31/20161/3/20171/4/2017

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,669
Members
448,977
Latest member
moonlight6

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