Way to sort Unique Values by time

RedOctoberKnight

Board Regular
Joined
Nov 16, 2015
Messages
150
Office Version
  1. 2016
Platform
  1. Windows
I'm using an array formula to find unique values in a list of shift times. My question is if there is a way to have that list sorted by time starting with the earliest?

{=IFERROR(INDEX($Z$4:$Z$35, MATCH(0, COUNTIF($AN$3:$AN4, $Z$4:$Z$35), 0)),"")}

Shift times are in the following format:

5:30-14:00
6:30-15:00
13:00-21:30
OFF

There will be more times than above. Was wondering if its able to sort them by the earliest start time.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I spent too long on this! but it was interesting. Try:

Book4
ZAN
1
2
3
45:30-14:00Shifts
56:30-15:002:00-11:30
613:00-21:305:30-14:00
7OFF6:30-15:00
86:30-15:008:00-9:00
913:00-21:308:00-9:45
108:00-9:0013:00-21:30
1121:00-23:4521:00-23:45
122:00-11:3023:00-7:30
136:30-15:00 
1423:00-7:30 
158:00-9:45 
16
Sheet1
Cell Formulas
RangeFormula
AN5:AN15AN5=IFERROR(TEXT(AGGREGATE(15,6,(INT(LEFT(SUBSTITUTE($Z$4:$Z$35,"-"," "),5)*1440)+RIGHT(SUBSTITUTE($Z$4:$Z$35,"-","0"),5))/(COUNTIF($AN$4:$AN4,$Z$4:$Z$35)=0),1)/1440,"h:mm")&"-"&TEXT(MOD(AGGREGATE(15,6,(INT(LEFT(SUBSTITUTE($Z$4:$Z$35,"-"," "),5)*1440)+RIGHT(SUBSTITUTE($Z$4:$Z$35,"-","0"),5))/(COUNTIF($AN$4:$AN4,$Z$4:$Z$35)=0),1),1),"h:mm"),"")


You'll see that it ignores the OFF value.
 
Upvote 0
wow, that worked perfectly! Thank you so much. I had no idea it would be that complicated. Thank you for taking the time to figure it out.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

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