Excel room inventory

Shahuru

New Member
Joined
Dec 4, 2018
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
When I put a date range in cell A1 (1/12/18) and cell A2 (5/12/18) I want to add the dates 1 2 3 4 5 to separate cells like, cell A3(1) cell A4(1) cell A5(1).... the idea is when i enter start date and end date, to add in between dates to a separate cells
I need to make a room inventory chart. Lets say total 6rooms avilable for the mentioned date. As when i put start date and end date as above, i want it to be deduced from the inventory and show the 5 rooms available as 1 is booked already. Hope you get what im trying to explain. Need urgent solution. Regards
SR
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try this:
Assumes you have StartDate in Range("A1")
And StopDate in Range("A2")

Code:
Sub Add_Dates()
'Modified  12/4/2018  9:40:21 PM  EST
Application.ScreenUpdating = False
Dim StartDate As Date
Dim EndDate As Date
Dim i As Long
Dim ct As Long
StartDate = DateValue(Range("A1").Value)
EndDate = DateValue(Range("A2").Value)
ct = DateDiff("d", StartDate, EndDate)
For i = 2 To ct
    Cells(i + 1, 1).Value = DateAdd("d", i - 1, StartDate)
Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
When I put Start date and End Date, I want the in between dates to fill the dates with "1" in the table and sum up with the existing numbers too. The idea is to manage a room inventory by adding start date and end date for each booking.


01-DecRoom Type1-Dec2-Dec3-Dec4-Dec5-Dec6-Dec7-Dec8-Dec9-Dec10-Dec11-Dec12-Dec13-Dec14-Dec
04-DecDeluxe111 444
King 2 3611
Room Type15-Dec16-Dec17-Dec18-Dec19-Dec20-Dec21-Dec22-Dec23-Dec24-Dec25-Dec26-Dec27-Dec28-Dec
Deluxe 222
King
<colgroup><col width="80" style="width: 60pt; mso-width-source: userset; mso-width-alt: 2792;"> <col width="62" style="width: 47pt; mso-width-source: userset; mso-width-alt: 2164;"> <col width="35" style="width: 27pt; mso-width-source: userset; mso-width-alt: 1233;" span="14"> <tbody> </tbody>
 
Upvote 0
Type
S Date
E Date
1 Dec
2 Dec
3 Dec
4 Dec
5 Dec
King
1 dec
4 dec
King
1
11
Deluxe
5
6
2

<tbody>
</tbody>

It works with date data , hence I want it to fill with numeric number "1 " as in the above table. S date is 1Dec E Date is 4 Dec. and Type King , and fil the dates as in red. If I select Deluxe as a Type and S date 3Dec and E date 5Dec , it should add 3dec 1 into 5 , 4dec 1 into 6

Appreciate your help

Many Thanks,
SR
 
Upvote 0
hi Shahuru,
if you record this transaction in this way,
try it,
A1 to A10, B1 to B10.
01/07/2018king
02/07/2018king
03/07/2018king
04/07/2018king
05/07/2018king
06/07/2018deluxe
07/07/2018deluxe
08/07/2018deluxe
09/07/2018deluxe

<colgroup><col span="2"></colgroup><tbody>
</tbody>

01/07/201802/07/201803/07/201804/07/201805/07/201806/07/201807/07/201808/07/201809/07/201810/07/2018
1111100001

<colgroup><col span="10"></colgroup><tbody>
</tbody>

=COUNTIFS($B$1:$B$30,$E$2,$A$1:$A$30,">="&P1,$A$1:$A$30,"<="&P1)
criteria mention on E2.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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