excel time range

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
444
Office Version
  1. 2019
hello all,
i'd like to ask anyway(formula / macro)that i can given out the best START time and END time in a range like these?

09:00-14:15HH14:15-18:30CR13:30-14:15AG14:15-21:30EE21:30-23:00DHL
09:00-18:30 ------------my request13:30-23:00 ------------my request

<colgroup><col><col></colgroup><tbody>
</tbody>

thanks guys and hope someone can point me out in right way
 
To enable a formula with variable rows, I had to add an extra row at the end of each list like this:

ABCDEFGHIJKLMNOPQRS
1(SUN)(MON)(TUE)(WED)(THU)(FRI)(SAT)(SUN)(MON)(TUE)(WED)(THU)(FRI)(SAT)
2Alex09:30-10:00
AA
13:30-21:45
AA
13:30-21:45
AA
09:30-10:00
AA
Alex09:30 - 19:0013:30 - 23:0013:30 - 23:0009:30 - 19:00
310:00-19:00
BB
21:45-22:15
BB
21:45-22:15
BB
10:00-19:00
BB
Bella09:00 - 18:3013:30 - 23:0011:00 - 20:3009:30 - 19:0009:00 - 18:30
422:15-23:00
CC
22:15-23:00
CC
Bethia09:00 - 18:3012:00 - 22:3013:00 - 22:3013:00 - 22:30
5Bella09:00-14:15
AA
13:30-14:15
AA
11:00-20:30
AA
09:30-14:15
AA
09:00-14:15
AA
Chelsea09:00 - 18:3009:30 - 19:0009:30 - 20:0009:30 - 19:00
614:15-18:30
BB
14:15-21:30
BB
14:15-19:00
BB
14:15-18:30
BB
Cherries09:30 - 17:30
721:30-23:00
CC
Cherry12:00 - 23:0011:00 - 21:0009:30 - 20:00
8Bethia09:00-09:30
AA
12:00-22:30
AA
13:00-22:30
AA
13:00-22:30
AA
End
909:30-18:30
BB
10Chelsea09:00-09:30
AA
09:30-14:15
AA
09:30-10:00
AA
09:30-19:00
AA
1109:30-18:30
BB
14:15-19:00
BB
10:00-20:00
BB
12Cherries09:30-17:30
AAA
13Cherry12:00-21:45
AA
11:00-21:00
AA
09:30-10:00
AA
1421:45-22:15
BB
10:00-20:00
BB
1522:15-23:00
CC
16End

<tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
M2{=IF(INDEX(B:B,MATCH($L2,$A:$A,0))="","",TEXT(MIN(IFERROR(TIMEVALUE(LEFT(INDEX(B:B,MATCH($L2,$A:$A,0)):INDEX(B:B,MATCH($L3,$A:$A,0)-1),5)),1)),"hh:mm")&" - "&TEXT(MAX(IFERROR(TIMEVALUE(MID(INDEX(B:B,MATCH($L2,$A:$A,0)):INDEX(B:B,MATCH($L3,$A:$A,0)-1),7,5)),0)),"hh:mm"))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



The formula is also now quite complex :)

WBD

YOU ARE AWESOME WBD!!!:cool: THANKS FOR THE GREAT WORK AND DEEPLY APPRECIATE
can it run by record macro? i tired and turn to error 1004:eek:
 
Last edited:
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
It's a formula; changing the cell contents on the left will automatically update the content on the right. There's no need to run a macro - it's constantly "live".

WBD
 
Upvote 0
It's a formula; changing the cell contents on the left will automatically update the content on the right. There's no need to run a macro - it's constantly "live".

WBD

i want to run a macro because of if i clear content the data and paste another new data for my crew, the formula will be incorrect(#REF) :(:p
 
Upvote 0
It will break if you delete rows or columns I'm sure. Pasting data over the top shouldn't make any difference.

WBD
 
Upvote 0
It will break if you delete rows or columns I'm sure. Pasting data over the top shouldn't make any difference.

WBD
this is BRILLIANT and thanks for that, save my time, WBD
understood that it will break if i delete it or clear content by right click
however i found if the second week crew member less than first week, the last row of my crew member shouldn't show up normal(00:00-00:00)

on the other contrary, i want to use macro which is seems to be accuracy & safety just precaution no one break my workbook by any mistake
known that there is limited character on array formula at macro, so i am reading more and more article to help/solve on it hopefully

i am also thinking to setup my crew member database as table in column A2, then use "sumifs+index+match" to look up sequentially:
date, name, start time, end time

will it be easier?:confused:
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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