Shift name based on timestamp

Dscalf1

New Member
Joined
Jun 14, 2015
Messages
41
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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
are the columns used the same as the formula above from Aryatect
user-offline.png
 
Upvote 0
are the columns used the same as the formula above from Aryatect
user-offline.png

No my columns are as follows:

The time stamp is in cell: BH6

My chart that looks like this Starts in cell CN4 :

CN CO CP
4 Shift Start Time End Time
5 First 6:21:00 14:20:00
6 Second 14:21:00 22:20:00
7 Third 22:21:00 6:20:00


the word first second or third should go in cell BI6
 
Last edited:
Upvote 0
just a thought but i think the date needs to be dropped i the formula otherwise they will never work :)
 
Upvote 0
just a thought but i think the date needs to be dropped i the formula otherwise they will never work :)

Code:
=IF(AND(BH6>=$CO$5,BH6<=$CP$5),$CN$5,IF(AND(BH6>=$CO$6,BH6<=$CP$6),$CN$6,IF(AND(BH6>=$CO$7,BH6<=0.99999),$CN$7,IF(AND(BH6>=0,BH6<=$CP$7),$CN$7))))

Okay just changed the format to just the time instead of date and time and this formula is still giving me a false instead of a shift name..
 
Upvote 0
i was thinking more on the INDEX / MATCH formula but using this formula (adjusted to remove the date) > =A2-INT(A2) The date portion is a whole number so this just leaves the time value

Like This >
Excel Workbook
ABCDE
1TimeShift17:25
200:00:00Third
306:21:00First
414:21:00Second
522:21:00Third
6Second
7
8CPCN
9colcol
Sheet1




 
Last edited:
Upvote 0
using your stated locations >
Excel Workbook
BHBIBJCMCNCOCP
2
3ShiftTime
4Third00:00:00
5First06:21:00
617:25SecondSecond14:21:00
7Third22:21:00
Sheet1
 
Upvote 0
i was thinking more on the INDEX / MATCH formula but using this formula (adjusted to remove the date) > =A2-INT(A2) The date portion is a whole number so this just leaves the time value

Like This > Sheet1

ABCDE
TimeShift
Third
First
Second
Third
Second
CPCN
colcol

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:81px;"><col style="width:73px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]

[TD="align: right"]17:25[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]00:00:00[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="align: right"]06:21:00[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="align: right"]14:21:00[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="align: right"]22:21:00[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]8[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]9[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
E6=IFERROR(INDEX($B$2:$B$5,MATCH(E1-INT(E1),$A$2:$A$5,1)),"ERROR")

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4




This worked!! Thank you so much!!
 
Upvote 0
just a matter of getting the right info from the right places :) The updated version should fit with your data
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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