+ Reply to Thread
Results 1 to 7 of 7

Grouping by times

  1. #1
    Registered User
    Join Date
    04-06-2018
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    7

    Grouping by times

    Greetings,

    I have a list of events along with the times they occurred. I want to group the times into shifts with the display being 1 for the first shift (midnight to 7AM), 2 for the second shift (7AM to 3PM), and 3 for the third shift (3PM to midnight). I then plan on putting my data into a pivot table so that I can easily count the events with the rows displaying as a 1,2,3 for each shift.

    Any help would be much appreciated.

  2. #2
    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,503

    Re: Grouping by times

    here is one way (adjust to your data)...
    =LOOKUP(HOUR(A2),{0,7,15},{"1","2","3"})
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    04-06-2018
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    7

    Re: Grouping by times

    Thanks. So if my times are displayed starting in F2 and I want to set the ranges as 0:00:01 to 7:00:00 as shift 1, 7:00:01 to 3:00:00 as shift 2, and 3:00:01 to 11:59:59 as shift 3, what would that look like?

  4. #4
    Registered User
    Join Date
    04-06-2018
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    7

    Re: Grouping by times

    Thanks. So if my times are displayed starting in F2 and I want to set the ranges as 0:00:01 to 7:00:00 as shift 1, 7:00:01 to 3:00:00 as shift 2, and 3:00:01 to 11:59:59 as shift 3, what would that look like?

  5. #5
    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,503

    Re: Grouping by times

    like this...
    =LOOKUP(HOUR(F2),{0,7,15},{"1","2","3"})
    it should work based on what you wrote (it does in my test file).

    or if you want them numeric instead of text then this...
    =LOOKUP(HOUR(F2),{0,7,15},{1,2,3})

  6. #6
    Registered User
    Join Date
    04-06-2018
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    7

    Re: Grouping by times

    That seems to work. Thanks!

  7. #7
    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,503

    Re: Grouping by times

    great, glad it worked for you and thank you for the rep!

+ 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. [SOLVED] Grouping Dates into Days and times into Groups
    By mgmerv in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-28-2015, 05:49 AM
  2. Grouping times by 15 minute intervals
    By frustrated in forum Excel General
    Replies: 2
    Last Post: 09-10-2015, 09:44 AM
  3. Grouping Times By 10 Second Interval
    By Kris.tina in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2014, 08:38 AM
  4. Help grouping times together
    By Darkflame808 in forum Excel General
    Replies: 3
    Last Post: 09-21-2009, 08:50 AM
  5. Grouping and performing same calculations multiple times per group
    By kmkielar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2009, 03:42 PM
  6. Grouping log in times into 15 minute intervals
    By jaywizz in forum Excel General
    Replies: 6
    Last Post: 05-12-2009, 04:59 AM
  7. [SOLVED] Grouping Times
    By Jamesy in forum Excel General
    Replies: 2
    Last Post: 04-19-2006, 06:30 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