+ Reply to Thread
Results 1 to 8 of 8

Calculate shift according time

  1. #1
    Registered User
    Join Date
    09-15-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Calculate shift according time

    Hi Everyone,


    I'm trying to calculate the shift worked between 3 shift

    Day Shift 07:00-14:00
    Afternoon shift 14:00- 23:00
    Night Shift 23:00-07:00 (next day)

    I have attached a simple excel sheet which has the correct hours manually entered. The cells highlighted orange was the two I has having issues with the following formula (not my work). (If start down 00:00- 07:00)

    =IF(HOUR(B5)<=14,"Dayshift",IF(HOUR(B5)>=23,"Nightshift","Afternoon"))

    I'm hoping you can help me.


    Thanks,
    Irfan
    Attached Files Attached Files
    Last edited by nafriirfan; 09-15-2017 at 04:36 AM. Reason: wrong

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Calculate shift according time

    Try
    =LOOKUP(HOUR(B5),{0,7,14,23},{"Nightshift","Dayshift","Afternoon","Nightshift"})
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Calculate shift according time

    OR TRY
    =IF(HOUR(B5)<7,"Nightshift",IF(HOUR(B5)<=14,"Dayshift",IF(HOUR(B5)>=23,"Nightshift","Afternoon")))

  4. #4
    Forum Contributor shivya's Avatar
    Join Date
    08-19-2017
    Location
    Delhi, India
    MS-Off Ver
    2013
    Posts
    240

    Re: Calculate shift according time

    wHAT IS THE ISSUE DEAR??

    I THINK, IT'S WORKING PROPERLY.
    YOU CAN CONVERT THE TIME INTO 24 HOUR FORMAT =TEXT(C12:C12,"[hh]:mm:ss"), AS YOU ENTERED THE TIME MANUALLY

  5. #5
    Registered User
    Join Date
    09-15-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Re: Calculate shift according time

    Thanks so much . Its work. But if I want to change clock become
    Day Shift 06:40-13:40
    Afternoon shift 13:40 - 22:40
    Night Shift 22:40-06:40 (next day)

    What change clock in formula use minutes??
    Thanks you soo much

    Rgds
    Irfan

  6. #6
    Registered User
    Join Date
    09-15-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Re: Calculate shift according time

    Thanks so much . Its work. But if I want to change clock become
    Day Shift 06:40-13:40
    Afternoon shift 13:40 - 22:40
    Night Shift 22:40-06:40 (next day)

    What change clock in formula use minutes??
    Thanks you soo much

    Rgds
    Irfan

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Calculate shift according time

    Edit:

    =LOOKUP(MOD(B5-1/36,1)*24,{0,6,13,22},{"Nightshift","Dayshift","Afternoon","Nightshift"})

  8. #8
    Registered User
    Join Date
    09-15-2017
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    4

    Re: Calculate shift according time

    @phuocam, @nflsales Thank you so much .Its work

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 06-10-2016, 11:38 PM
  2. Replies: 5
    Last Post: 12-02-2015, 03:09 PM
  3. [SOLVED] Calculate Start and End Time Stored as HH:MM when Shift extend past 00:00 (midnight)?
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2015, 12:38 PM
  4. Replies: 10
    Last Post: 11-08-2014, 04:51 PM
  5. Replies: 0
    Last Post: 06-14-2014, 02:48 PM
  6. Need Help on Time Sheet Formula (Day Shift OK/Night Shift=Problem)
    By jomapac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-18-2013, 02:26 AM
  7. Day shift/night shift time calculation issue
    By STATEXCEL in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-31-2007, 08:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1