Time intervals

MaayanYogev

New Member
Joined
Feb 5, 2023
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Time intervals
I have a database of flight arrival times and would like to group them into intervals of 45 minutes, starting from the first hour.
FLOORfunction is problematic here because it rounds down the minutes.

For example:

14:05:00 -- I need the interval to start at 14:05, but "FLOOR" starts if from 14:00
14:12:00
14:18:00
14:45:00

How can I solve this issue?

Thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I'm sure there is a better way, but this will give you the 'Every 45 minute start time'
2:00 PM is not evenly divisible by :45 minutes, so this start time is 1:30.


=(45*(INT((HOUR(A2)*60+MINUTE(A2))/45))/(60*24))
 
Upvote 0
Hi,

What is the significance you are using in your Floor function ....?
You could test : 0.0342
 
Upvote 0
I think this will get you with 45 min intervals starting at 2:00 PM
=((45*(INT((HOUR(A2)*60+MINUTE(A2))/45)))/(60*24))+IF(MOD((HOUR(A2)*60+MINUTE(A2)),45)>=30,1/48,0)
I was wrong. :(
 
Upvote 0
Thank you all!
It's still not the exact result I'm looking for,
adding a picture of the current values that I'm getting with 'FLOOR'- on red, and on green- the desired outcome (I simulated a few rows manually)
*the operation is on the Arv. Time column

WhatsApp Image 2023-02-05 at 16.14.33.jpeg
 
Upvote 0
Were you getting any errors with this:

=((45*(INT((HOUR(A2)*60+MINUTE(A2))/45)))/(60*24))+IF(MOD((HOUR(A2)*60+MINUTE(A2)),45)>=30,1/48,-0.5/48)
 
Upvote 0
Thank you all!
It's still not the exact result I'm looking for,
adding a picture of the current values that I'm getting with 'FLOOR'- on red, and on green- the desired outcome (I simulated a few rows manually)
*the operation is on the Arv. Time column

View attachment 84654
I don't understand what you are asking for, then. Your desired results are not in multiples of 45 minutes starting at 2:00 pm?
 
Upvote 0
Were you getting any errors with this:

=((45*(INT((HOUR(A2)*60+MINUTE(A2))/45)))/(60*24))+IF(MOD((HOUR(A2)*60+MINUTE(A2)),45)>=30,1/48,-0.5/48)
Thank you so much!
That works with no errors, but the issue is splitting big data into 45 minutes intervals when the first value is not always the same.. for example, look at the picture Im sending- I need the function to "understand" to put the 'arv. Time' of 16:40 with 17:10 and 17:20 at the same 'Transportation time' (16:40).
**functions are on the 'Transportation Time' column
WhatsApp Image 2023-02-05 at 17.28.35.jpeg
 
Upvote 0
Thank you so much!
That works with no errors, but the issue is splitting big data into 45 minutes intervals when the first value is not always the same.. for example, look at the picture Im sending- I need the function to "understand" to put the 'arv. Time' of 16:40 with 17:10 and 17:20 at the same 'Transportation time' (16:40).
**functions are on the 'Transportation Time' column
View attachment 84658
That is contrary to your requirement. the 45 Minute Interval groups (starting at 2:00 PM) are:
Mr Excel Questions2.xlsm
ABC
1ArrStart of Time GroupEnd of Time Group
214:0514:0014:45
314:1214:0014:45
414:1814:0014:45
514:1814:0014:45
614:3614:0014:45
714:4514:4515:30
815:0614:4515:30
915:2614:4515:30
1016:4016:1517:00
1116:4016:1517:00
1217:1017:0017:45
1317:2017:0017:45
Sheet6
Cell Formulas
RangeFormula
B2:B13B2=((45*(INT((HOUR(A2)*60+MINUTE(A2))/45)))/(60*24))+IF(MOD((HOUR(A2)*60+MINUTE(A2)),45)>=30,1/48,-0.5/48)
C2:C13C2=B2+45/(24*60)
A10:A11A10=TIME(16,40,0)
A12A12=TIME(17,10,0)
A13A13=TIME(17,20,0)


Please explain why I am thinking differently than you?
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

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