Shift name based on timestamp

Dscalf1

New Member
Joined
Jun 14, 2015
Messages
40
Hello I am trying to get a shift name based on a timestamp in a different cell. For example if my timestamp says "6/19/2019 13:41:37" I want the word "First" to show up in the next column to identify the shift name. I have searched and searched for an answer to this and cant seem to find it... The shift times are: First: 6:21-14:20, Second: 14:21-22:20 third: 22:21-6:20.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
are there any other overlays that need to be considered, otherwise its a case of extracting the right hand time value and comparing to less than 1
 

Dscalf1

New Member
Joined
Jun 14, 2015
Messages
40
are there any other overlays that need to be considered, otherwise its a case of extracting the right hand time value and comparing to less than 1

Im not exactly sure what youre asking but essentially the times wouldnt overlap so for example.. 6:20:59 would be third shift and as soon as 6:21:00 hit it would be first shift
 

Aryatect

Active Member
Joined
Jun 17, 2019
Messages
308
Hi Dscalf1,

I put all the Shift timings and shift in the excel starting with A1 shown below:

ShiftStart Time End Time
First6:21:0014:20:00
Second14:21:0022:20:00
Third22:21:006:20:00

<tbody>
</tbody>

and then put my time stamp in cell F2 and used below formula in G2

Code:
=IF(AND(F2>=$B$2,F2<=$C$2),$A$2,IF(AND(F2>=$B$3,F2<=$C$3),$A$3,IF(AND(F2>=$B$4,F2<=0.99999),$A$4,IF(AND(F2>=0,F2<=$C$4),$A$4))))

Let me know if it works for you.

Thanks

Hello I am trying to get a shift name based on a timestamp in a different cell. For example if my timestamp says "6/19/2019 13:41:37" I want the word "First" to show up in the next column to identify the shift name. I have searched and searched for an answer to this and cant seem to find it... The shift times are: First: 6:21-14:20, Second: 14:21-22:20 third: 22:21-6:20.
 
Last edited:

Aryatect

Active Member
Joined
Jun 17, 2019
Messages
308

ADVERTISEMENT

Another easier option would be:

putting the column starting with A1 again:

TimeShift
0:00:00 Third
6:21:00 First
14:21:00 Second
22:21:00 Third

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

then putting time stamp in E2 and putting below formula in F2:

Code:
=INDEX($B$2:$B$5,MATCH(E2,$A$2:$A$5,1))

This should be a simple one.

Im not exactly sure what youre asking but essentially the times wouldnt overlap so for example.. 6:20:59 would be third shift and as soon as 6:21:00 hit it would be first shift
 

Dscalf1

New Member
Joined
Jun 14, 2015
Messages
40
Another easier option would be:

putting the column starting with A1 again:

TimeShift
0:00:00Third
6:21:00First
14:21:00 Second
22:21:00 Third

<tbody>
</tbody>

then putting time stamp in E2 and putting below formula in F2:

Code:
=INDEX($B$2:$B$5,MATCH(E2,$A$2:$A$5,1))

This should be a simple one.

This one did not work for me it is showing an N/A but I think the first answer was going to work its just taking me a while to convert to the cells Im using! Ill let you know!
 

Dscalf1

New Member
Joined
Jun 14, 2015
Messages
40

ADVERTISEMENT

Another easier option would be:

putting the column starting with A1 again:

TimeShift
0:00:00Third
6:21:00First
14:21:00 Second
22:21:00 Third

<tbody>
</tbody>

then putting time stamp in E2 and putting below formula in F2:

Code:
=INDEX($B$2:$B$5,MATCH(E2,$A$2:$A$5,1))

This should be a simple one.

This returned false for me...
 

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
are you using actual time values? or text that looks like time?
 

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
if you in another cell use = ISNUMBER(your cell date time value) and it returns as true then it is time, false will say it is text
 

Watch MrExcel Video

Forum statistics

Threads
1,130,278
Messages
5,641,279
Members
417,202
Latest member
AndyVBA

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
Top