Dividing week up in to 6hr blocks using date and time data

jlaff

New Member
Joined
Aug 26, 2024
Messages
4
Office Version
  1. 2021
Platform
  1. MacOS
Hi,

I have a large (11k rows) data set for a health research project. Each event has a date and time value. Please see image attached.

I want to put these in to 28 groups across the week (each bucket containing a quarter of a day) - ie Group 1: Sun 00:00-05:59, Group 2 Sun 06:00-11:59, .... Group 23 Sat 12:00-17:59, Group 24 Sat 18:00-23:59. Is there an excel command that I can use for this?

Apologies my excel knowledge is minimal but there is a lot of work to manually do each one. I have merged them in to one column and have also generated a day of the week column as well if that helps!

Many thanks,

Jack
 

Attachments

  • Screenshot 2025-01-30 at 11.15.34.png
    Screenshot 2025-01-30 at 11.15.34.png
    25.8 KB · Views: 4

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi, something like this maybe..

Book3
EFG
1DateTimeGroup
226/12/201213:23Wed 12:00-17:59
327/12/201221:30Thu 18:00-23:59
429/12/201210:48Sat 06:00-11:59
530/12/201217:30Sun 12:00-17:59
630/12/201214:49Sun 12:00-17:59
730/12/201202:12Sun 00:00-05:59
830/12/201220:49Sun 18:00-23:59
931/12/201201:08Mon 00:00-05:59
1031/12/201206:00Mon 06:00-11:59
1131/12/201205:59Mon 00:00-05:59
1230/01/202518:00Thu 18:00-23:59
1331/01/202517:59Fri 12:00-17:59
Sheet1
Cell Formulas
RangeFormula
G2:G13G2=LET(s,FLOOR(F2,"06:00"),e,s+"05:59",TEXT(E2,"ddd")&" "&TEXT(s,"hh:mm")&"-"&TEXT(e,"hh:mm"))
 
Upvote 0

Forum statistics

Threads
1,226,114
Messages
6,189,052
Members
453,522
Latest member
Seeker2025

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