Calculating available hotel rooms

Declamatory

Active Member
Joined
Nov 6, 2014
Messages
319
Good morning,

I have a download table. For each date the right hand column represents the number of rooms available and the left hand number represents take up.

On a separate tab I need to be able to show how many rooms are still has left on each date for each room type.

Can anybody help me please.

Thanks

[TABLE="width: 1036"]
<tbody>[TR]
[TD]Room Type[/TD]
[TD="align: right"]19/10/2019[/TD]
[TD="align: right"] 20/10/2019[/TD]
[TD="align: right"] 21/10/2019[/TD]
[TD="align: right"]22/10/2019[/TD]
[TD="align: right"] 23/10/2019[/TD]
[TD="align: right"]24/10/2019[/TD]
[TD="align: right"]25/10/2019[/TD]
[TD="align: right"] 26/10/2019[/TD]
[TD="align: right"]27/10/2019[/TD]
[TD="align: right"] 28/10/2019[/TD]
[TD] Total[/TD]
[/TR]
[TR]
[TD]Allocated Shared Accommodation[/TD]
[TD]'0/20'[/TD]
[TD]'0/100'[/TD]
[TD]'0/170'[/TD]
[TD]'3/220'[/TD]
[TD]'3/220'[/TD]
[TD]'3/220'[/TD]
[TD]'3/220'[/TD]
[TD]'0/60'[/TD]
[TD]'0/10'[/TD]
[TD]'0/0'[/TD]
[TD]'12/1,240'[/TD]
[/TR]
[TR]
[TD]Single Occupancy Room[/TD]
[TD]'0/80'[/TD]
[TD]'0/170'[/TD]
[TD]'1/350'[/TD]
[TD]'11/490'[/TD]
[TD]'11/490'[/TD]
[TD]'11/490'[/TD]
[TD]'11/490'[/TD]
[TD]'1/200'[/TD]
[TD]'0/20'[/TD]
[TD]'0/0'[/TD]
[TD]'46/2,780'[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]'0/100'[/TD]
[TD]'0/270'[/TD]
[TD]'1/520'[/TD]
[TD]'14/710'[/TD]
[TD]'14/710'[/TD]
[TD]'14/710'[/TD]
[TD]'14/710'[/TD]
[TD]'1/260'[/TD]
[TD]'0/30'[/TD]
[TD]'0/0'[/TD]
[TD]'58/4,020'[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
this works with the ' removed from the data table (e.g. Find and Replace All)


Book1
ABCDEFGHIJKL
1Room Type19/10/201920/10/201921/10/201922/10/201923/10/201924/10/201925/10/201926/10/201927/10/201928/10/2019Total
2Allocated Shared Accommodation0/200/1000/1703/2203/2203/2203/2200/600/100/012/1,240
3Single Occupancy Room0/800/1701/35011/49011/49011/49011/4901/2000/200/046/2,780
4Total0/1000/2701/52014/71014/71014/71014/7101/260
5
6Room Type19/10/201920/10/201921/10/201922/10/201923/10/201924/10/201925/10/201926/10/201927/10/201928/10/2019
7Allocated Shared Accommodation20100170217217217217601001228
8Single Occupancy Room801703494794794794791992002734
9Total100270519696696696696259
Sheet3
Cell Formulas
RangeFormula
B7=RIGHT(SUBSTITUTE(B2,"/",REPT(" ",50)),50)-LEFT(SUBSTITUTE(B2,"/",REPT(" ",50)),50)
 
Upvote 0
Hi there. Set up your separate tab with the same layout as the source(Room Types in first column (column A), dates in first row(row 1). Then put this formula in cell B2 and drag across and down:

=-MID(LEFT(Sheet1!B2,FIND("/",Sheet1!B2)-1),2,2)+MID(Sheet1!B2,FIND("/",Sheet1!B2)+1,LEN(Sheet1!B2)-FIND("/",Sheet1!B2)-1)

NB This will only work if your data is exactly as you show, it assumes a single character at the beginning and end of each cell (the single quotes), and a single slash separating the 2 values.
 
Last edited:
Upvote 0
just curious, which solution you'd ended up with?
 
Upvote 0
Hi Alan,

The second solution meant that I didn't have to do the find and replace. Both worked but the second solution means I can just paste the download into sheet 1.

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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