Formula to check the time between and give pricing

aliaslamy2k

Active Member
Joined
Sep 15, 2009
Messages
416
Office Version
  1. 2019
Platform
  1. Windows
Dear Experts,

I am looking for a formula in excel to check the time and give and give the pricing accordingly.
Example : If a tennis court is booked between 15:00 to 16:00 the price is 70 for 1 hour and same court is booked between another timings the price should change accordingly.

I have attached the excel sheet for reference.

Thank you so much
 

Attachments

  • Excel.png
    Excel.png
    29.9 KB · Views: 11

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Given your apparent data set, maybe like.....
Book1
BCDEFGHIJKLM
3Tennis
4Booking Time1hr2hr4+ HrsNameFromToHoursPrice
515:0016:0070ABC15:0016:001.0070
618:0022:0090160300DEF18:0020:002.00160
722:0023:5970120GHI22:0023:001.0070
8Tournament80160ABC23:0023:591.0070
9DEF22:0023:592.00120
10GHI18:0022:004.00300
11Tournament14:0016:002.00160
12Tournament18:0019:001.0080
13  
Sheet1
Cell Formulas
RangeFormula
L5:L13L5=IF(I5="","",ROUNDUP(24*(K5-J5),0))
M5:M13M5=IF(I5="","",INDEX($D$5:$F$8,IF(I5="Tournament",4,IF(K5<=$C$5,1,IF(K5<=$C$6,2,IF(K5<=$C$7,3,4)))),MIN(3,L5)))


Hope that helps.
 
Upvote 0
Hi Snakehips,

Thank you so much, It is working very well ! ?

Thanks a million

AB
 
Upvote 0
Hi Snakehips,

Can you please help me with the attached problem. This time i need to get the results based on criteria.
Example : Football : 1/3 Pitch, one hour charge is 200, one and half hour charge is 300 and two hour charge is 400. Same with 1/2 Pitch and Full Pitch

Example 2: Same as above for Multipurpose hall.

Thank you so much for your wonderful solution.

Kind regards,
AB
 

Attachments

  • Question 2.JPG
    Question 2.JPG
    161.5 KB · Views: 8
Upvote 0
AB, try this.

Book1
ABCDEFGHIJKLMN
14
15Football
16
17Booking1Hr1Hr 30Min2HrsBookingFromToHoursPrice
181/3Pitch2003004001/3Pitch15:0016:001200
191/2Pitch3004506001/2Pitch18:0020:002600
20Full Pitch6008001000Full Pitch22:0023:001600
211/2Pitch10:0011:301.5450
22Full Pitch22:0023:5921000
23
24
25Mult Hall
26
27Booking 1Hr2HrBookingFromToHoursPrice
28Batmenton70130Batmenton15:0016:00170
29Volleyball250450Volleyball18:0020:002450
30Basketball250450Basketball22:0023:001250
31Footsall250450Footsall10:0011:001250
32Outdoor basketball120220Outdoor basketball14:0016:002220
33Batmenton22:0023:592130
34
Sheet2
Cell Formulas
RangeFormula
M28:M33,M18:M22M18=IF(K18="","",MROUND(24*(L18-K18),0.5))
N18:N22N18=INDEX($A$18:$D$20,MATCH(J18,$A$18:$A$20,0),LOOKUP(M18,{1,1.5,2},{1,2,3})+1)
N28:N33N28=INDEX($A$28:$C$32,MATCH(J28,$A$28:$A$32,0),M28+1)


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

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