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

Room Type19/10/2019 20/10/2019 21/10/201922/10/2019 23/10/201924/10/201925/10/2019 26/10/201927/10/2019 28/10/2019 Total
Allocated Shared Accommodation'0/20''0/100''0/170''3/220''3/220''3/220''3/220''0/60''0/10''0/0''12/1,240'
Single Occupancy Room'0/80''0/170''1/350''11/490''11/490''11/490''11/490''1/200''0/20''0/0''46/2,780'
Total'0/100''0/270''1/520''14/710''14/710''14/710''14/710''1/260''0/30''0/0''58/4,020'

<tbody>
</tbody>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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,216,728
Messages
6,132,358
Members
449,720
Latest member
NJOO7

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