Sorting time range between customized periods

oreng

New Member
Joined
Mar 2, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi there, I need your support in developing formula that can sort hours by pre set periods of the day as follows (now done manually) :
Thanks
1709423491203.png
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
In D2 copied to full range.
Excel Formula:
=MEDIAN(INDEX($L$1:$L$4,MATCH(D$1,$J$1:$J$4,0)),INDEX($K$1:$K$4,MATCH(D$1,$J$1:$J$4,0)),$B2+IF($B2<$A2,1,0))-MEDIAN(INDEX($L$1:$L$4,MATCH(D$1,$J$1:$J$4,0)),INDEX($K$1:$K$4,MATCH(D$1,$J$1:$J$4,0)),$A2)

startenddurationpeak-AMPeak-PMOff peakNightpeak-AM
06:00​
10:00​
08:00​
22:00​
14:00​
02:00​
04:00​
05:00​
03:00​
Off peak
10:00​
15:00​
08:00​
10:00​
02:00​
02:00​
00:00​
00:00​
00:00​
Peak-PM
15:00​
19:00​
Night
19:00​
30:00​
 
Upvote 0
Solution

Forum statistics

Threads
1,215,836
Messages
6,127,177
Members
449,368
Latest member
JayHo

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