# Shift name based on timestamp

#### Dscalf1

##### New Member
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
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
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
Hi Dscalf1,

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

 Shift Start Time End Time First 6:21:00 14:20:00 Second 14:21:00 22:20:00 Third 22:21:00 6: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

Another easier option would be:

putting the column starting with A1 again:

 Time Shift 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
Another easier option would be:

putting the column starting with A1 again:

 Time Shift 0:00:00 Third 6:21:00 First 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

Another easier option would be:

putting the column starting with A1 again:

 Time Shift 0:00:00 Third 6:21:00 First 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
are you using actual time values? or text that looks like time?

#### Dscalf1

##### New Member
are you using actual time values? or text that looks like time?

Its an actual time value I believe. It is in the format "m/d/yyyy hh:mm:ss"

#### mole999

##### Moderator
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

Replies
3
Views
86
Replies
3
Views
76
Replies
11
Views
240
Replies
14
Views
176
Replies
2
Views
268

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.

### Which adblocker are you using?

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

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