Sum the Total room nights

Andrea1984

New Member
Joined
Nov 15, 2022
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
Hello Everyone ,
Unfortuantely i cannot load the Excel sheet otherwise i would have since it would have been simple .
The Problem is the following:
In the Monthly TAB i would like to report the Total number of rooms for a specific room type Example ( Standard ) by a Specific Market Segement ( OTA_PROMO) .
I have tried the below formula in the monthly Tab however the challenge that i am having is that is not giving me the correct Total since some bookings come in December and leave in January and i would need the correct Total of rooms in January


=SUMIFS(Data!$C1:$C375,Data!$D1:$D375,">="&$A$2,Data!$D1:$D375,"<="&$A$3,Data!$B1:$B375,"Guaranteed",Data!$H1:$H375,"OTA_PROMO",Data!$J1:$J375,A5)
 

Attachments

  • dataexcel.PNG
    dataexcel.PNG
    134.1 KB · Views: 21
  • Monthly.PNG
    Monthly.PNG
    7 KB · Views: 20
I know since I see it from the property management system
Unfortunately, a formula can not work based on what you know. We have to tell the formula what is correct.

When there are multiple room types in one cell, this formula will use the first one in the cell for the count, anything after that will be ignored. It gives the correct results for the example but it may not necessarily be accurate with a different data set.

JasonData File .xlsx
AB
1
201/01/2022
331/01/2022
4RMOTA_PROMO
5STANDARD147
6DELUXE233
7J_SUITE36
8CORNERSTUDIO33
9M_SUITE50
10Total499
Monthly
Cell Formulas
RangeFormula
B5:B9B5=SUMPRODUCT(TEXT(NETWORKDAYS.INTL(IF(Data!$D$2:$D$2257>=$A$2,Data!$D$2:$D$2257,$A$2),IF(Data!$E$2:$E$2257<=$A$3,Data!$E$2:$E$2257-1,$A$3),"0000000"),"0;\0;\0")*(Data!$B$2:$B$2257="Guaranteed")*(Data!$H$2:$H$2257="OTA_PROMO")*IFERROR((SEARCH(A5,Data!$J$2:$J$2257)=1),0))
B10B10=SUM(B5:B9)
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Unfortunately, a formula can not work based on what you know. We have to tell the formula what is correct.

When there are multiple room types in one cell, this formula will use the first one in the cell for the count, anything after that will be ignored. It gives the correct results for the example but it may not necessarily be accurate with a different data set.

JasonData File .xlsx
AB
1
201/01/2022
331/01/2022
4RMOTA_PROMO
5STANDARD147
6DELUXE233
7J_SUITE36
8CORNERSTUDIO33
9M_SUITE50
10Total499
Monthly
Cell Formulas
RangeFormula
B5:B9B5=SUMPRODUCT(TEXT(NETWORKDAYS.INTL(IF(Data!$D$2:$D$2257>=$A$2,Data!$D$2:$D$2257,$A$2),IF(Data!$E$2:$E$2257<=$A$3,Data!$E$2:$E$2257-1,$A$3),"0000000"),"0;\0;\0")*(Data!$B$2:$B$2257="Guaranteed")*(Data!$H$2:$H$2257="OTA_PROMO")*IFERROR((SEARCH(A5,Data!$J$2:$J$2257)=1),0))
B10B10=SUM(B5:B9)
Hi Jason
Apologies for the delay in coming back to you unfortuantely i contracted Covid .
Thank you for the Formula it works and really appreciated your help . Please could i ask you what i need to change on the Formula to calculate the revenue that is in the Coloum L
thank you
 
Upvote 0
If we are to assume that the revenue in column L is for all nights and that you want to calculate it pro-rata for the chosen month / period then it will be
Excel Formula:
=SUMPRODUCT(IFERROR((TEXT(NETWORKDAYS.INTL(IF(Data!$D$2:$D$2257>=$A$2,Data!$D$2:$D$2257,$A$2),IF(Data!$E$2:$E$2257<=$A$3,Data!$E$2:$E$2257-1,$A$3),"0000000"),"0;\0;\0")*(Data!$B$2:$B$2257="Guaranteed")*(Data!$H$2:$H$2257="OTA_PROMO")*(SEARCH(A5,Data!$J$2:$J$2257)=1))/(Data!$E$2:$E$2257-Data!$D$2:$D$2257),0),Data!$L$2:$L$2257)
 
Upvote 0
If we are to assume that the revenue in column L is for all nights and that you want to calculate it pro-rata for the chosen month / period then it will be
Excel Formula:
=SUMPRODUCT(IFERROR((TEXT(NETWORKDAYS.INTL(IF(Data!$D$2:$D$2257>=$A$2,Data!$D$2:$D$2257,$A$2),IF(Data!$E$2:$E$2257<=$A$3,Data!$E$2:$E$2257-1,$A$3),"0000000"),"0;\0;\0")*(Data!$B$2:$B$2257="Guaranteed")*(Data!$H$2:$H$2257="OTA_PROMO")*(SEARCH(A5,Data!$J$2:$J$2257)=1))/(Data!$E$2:$E$2257-Data!$D$2:$D$2257),0),Data!$L$2:$L$2257)
thank you i tried it and it does not work , is there a missing part ?
 
Upvote 0
It's all there, I get results from the test file that you provided for the original question (16091.50 for standard).
 
Upvote 0
If we are to assume that the revenue in column L is for all nights and that you want to calculate it pro-rata for the chosen month / period then it will be
Excel Formula:
=SUMPRODUCT(IFERROR((TEXT(NETWORKDAYS.INTL(IF(Data!$D$2:$D$2257>=$A$2,Data!$D$2:$D$2257,$A$2),IF(Data!$E$2:$E$2257<=$A$3,Data!$E$2:$E$2257-1,$A$3),"0000000"),"0;\0;\0")*(Data!$B$2:$B$2257="Guaranteed")*(Data!$H$2:$H$2257="OTA_PROMO")*(SEARCH(A5,Data!$J$2:$J$2257)=1))/(Data!$E$2:$E$2257-Data!$D$2:$D$2257),0),Data!$L$2:$L$2257)

It's all there, I get results from the test file that you provided for the original question (16091.50 for standard).
ok i will need to try it on the other Computer that i have at work since on my personal laptop i am having issues with excel
 
Upvote 0
You might need to array confirm the formula by pressing Ctrl Shift Enter instead of just Enter (this will be necessary with excel 2019 or older).
 
Upvote 0
You might need to array confirm the formula by pressing Ctrl Shift Enter instead of just Enter (this will be necessary with excel 2019 or older).
Dear Jason
I wanted to thank you for your help i have sent the day creating the report that i needed and without your assistance it would have been a nightmare .
I had 2 questions.
1. how do i modify the formula to give me the totals of a OTA Promo without taking in consideration the Room types ?
2. The second question is how do i modify the formula that it gives me the Total of the OTA Promo per day of the week ?

I am new on the forum and since i reallly appreciate your help if you are based in London i wanted to send you a voucher for a meal in one of restaurants .
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

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