+ Reply to Thread
Results 1 to 21 of 21

Brief formula to convert time values to "shift1", "shift2", "shift3".

  1. #1
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Brief formula to convert time values to "shift1", "shift2", "shift3".

    Hi - needed brief formula returning from time cells (ex. list below) text info "A", "B", "C" or "shift1", etc.
    Where:
    from 06:00:00 to 14:00:00 is "shift1"
    from 14:00:01 to 22:00:00 is "shift2"
    from 22:00:01 to 05:59:59 is "shift3"


    08:30:22
    04:57:57
    11:11:55
    04:54:45
    11:33:44
    04:48:57
    21:26:46
    12:52:33
    13:46:20
    13:21:55
    12:28:38
    05:21:27
    10:48:07
    05:17:20
    04:59:49
    00:53:19
    21:06:47
    23:10:59
    20:48:31
    20:24:48
    16:35:28
    12:18:21
    20:56:30
    13:18:11
    12:33:45
    12:43:15
    05:18:53
    07:18:55
    05:19:01
    20:27:18
    17:02:08
    19:26:45
    21:05:22
    13:31:11
    Last edited by darekpawel; 04-11-2019 at 06:59 AM.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    If data starts in A1, put into A2:

    Please Login or Register  to view this content.
    and drag it down
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Well... I'm doing something wrong?
    Data starts in A1, and the returned I want in column B.

    Attachment 619465

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    maybe this one...
    =IF(AND(A1>=0.25,A1<=0.5833333),"shift 1",IF(AND(A1>=0.5833449,A1<0.9166667),"shift 2","shift 3"))
    if you need to account for blanks then...
    =IF(A1="","",IF(AND(A1>=0.25,A1<=0.5833333),"shift 1",IF(AND(A1>=0.5833449,A1<0.9166667),"shift 2","shift 3")))
    change commas to semicolons if your settings require that.
    Last edited by Sam Capricci; 04-10-2019 at 08:04 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Getting only "shift1"... Which is not true.

    Attachment 619469

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Sorry, of course if data starts in A1, it should be in B1 not A2.
    Works for me. Are you sure that your data is date not text which looks like date?

    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 04-10-2019 at 07:55 AM.

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Quote Originally Posted by Sambo kid View Post
    =IF(AND(A1>=0.25,A1<=0.5833333),"shift 1",IF(AND(A1>=0.5833449,A1<0.9166667),"shift 2","shift 3"))
    if you need to account for blanks then...
    =IF(A1="","",IF(AND(A1>=0.25,A1<=0.5833333),"shift 1",IF(AND(A1>=0.5833449,A1<0.9166667),"shift 2","shift 3")))
    Sambo how did You get this N169? :-)

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    FYI, I'm not sure if KOKOSEK can open your attachments but when I click on them I get an "invalid attachment" message. That is one item.
    another thing, if you respond to someone it can be helpful that you either address the person you are replying to or note the post number (not sure if you were responding to me in post #5) but again, your attachment I cannot open (go advanced, then manage attachments etc. to upload a sample workbook if your issue isn't resolved).
    So if neither are working maybe you have text instead of numbers (formatted to look like time).

  9. #9
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Quote Originally Posted by KOKOSEK View Post
    Sorry, of course if data starts in A1, it should be in B1 not A2.
    Works for me. Are you sure that your data is date not text which looks like date?

    Please Login or Register  to view this content.

    All cells are formatted as a "time"...


    b734bfcc206b7f55med.jpg
    Last edited by darekpawel; 04-10-2019 at 08:08 AM.

  10. #10
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Sambo how did You get this N169? :-)
    LOL, didn't catch them all. That was the area of a test file where I plugged in the times. I tried to spot them all and change them to A1, guess I missed that one. (Only partway through my morning caffeine allotment.)

    Edited it and made the correction. Maybe that is why it wasn't returning the correct value as requested.

  11. #11
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    I can open the attached "jpg's" on other PC's... Not sure why you can not open them...

    Once again: the cells are formatted as "time" not as "date"...
    Data uploaded from SAP - and it exports only like that example: "13:27:11".
    Last edited by darekpawel; 04-10-2019 at 08:14 AM.

  12. #12
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    I'm attaching my example for you, I corrected the one part in the formula that pointed at column N but otherwise it is as I posted it in post #4
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Yes, in the example you attached it works... As I see..

    But when I implement that in my xls - than this is not working...
    Even if I format to "custom" = hh:mm:ss...
    In all cells I see "shift3".




    4.jpg

  14. #14
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Are you Jurop (Italy).
    Your default regional time separator is "." (point) not ":" (semi-colon).
    Temporarily change your regional settings to UK or US and see if this is answer.
    torachan.

  15. #15
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Quote Originally Posted by torachan View Post
    Are you Jurop (Italy).
    Your default regional time separator is "." (point) not ":" (semi-colon).
    Temporarily change your regional settings to UK or US and see if this is answer.
    torachan.
    I don't think so.
    If I am correctly read nick OP is Polish (as I am) and 'Jurop' is phonetic 'Europe' in Polish language.

  16. #16
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    It looks like exporting from SAP to xls is causing some hidden formatting in xls preventing proper formula calculation...
    I do not have possibility to export from SAP the time data with other separator than “:”...

    P.S. Yes, PL...

  17. #17
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Does the export data contain a full date/time stamp.
    if so is it the date element format that is the 'hidden' problem.
    torachan.

  18. #18
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    I've looked into the problem.
    The data exported from SAP to xls has one "space" added in front of each "time" series.
    When I remove manually in xls the "space" - then the problem is solved.

    On the other hand I have no idea why SAP is adding the 1 "space"...

  19. #19
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    So let's cut this leading space and convert it to number (date is a number):

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    09-19-2018
    Location
    Jurop
    MS-Off Ver
    2010
    Posts
    11

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    Yes, this is solving that issue/problem.
    Thank you everyone!

  21. #21
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Brief formula to convert time values to "shift1", "shift2", "shift3".

    You welcome. (<PL ON>Nie ma sprawy </PL OFF>)
    If you happy with solution please use thread tools and mark thread as SOLVED.

+ 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: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. [SOLVED] Excel 2007: How to Convert "5/2/2013" to "May" then subtract a Month so it's "Apr"
    By Golom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 02:00 AM
  4. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  5. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  6. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  7. Replies: 5
    Last Post: 10-12-2010, 06:46 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