+ Reply to Thread
Results 1 to 4 of 4

Group time in ranges

  1. #1
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Group time in ranges

    I am not sure if I put the best title of this thread, but what i need is, I have huge list of time which i want to put in some group like between 0-1 hrs, 2-4 hrs etc.

    Lets say I have data in COl A and in Col B i want to label the to the group it should below. Right now i m doing it manually using filters, just want to see of there is any formula I can use.

    Below are the groups I need.. And i m attaching a sample data for better understanding.

    Less then 1 hour
    1 -2 Hours
    2 -4 Hours
    4 - 6 Hours
    6 - 12 Hours
    12 - 18 Hours
    18 - 24 Hours
    24 - 36 Hours
    36 - 72 Hours
    72 - 168 Hours
    > 168 Hours
    Attached Files Attached Files

  2. #2
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Group time in ranges

    Hi, amitmodi_mrt!

    I suggest this steps:

    1. Create an adittional column with the limit upper bound of ranges. If you want a formula, you can use:
    [M2] : =IFERROR(--LEFT(SUBSTITUTE(SUBSTITUTE(N2,"> ",""),"-"," "),3),)

    2. Create a formula that obtain the resultant text:
    [B2] : =LOOKUP(A2*24,M$2:N$12)

    Check file with this option developed. Blessings!
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Group time in ranges

    Thank You John.. It worked perfect.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Group time in ranges

    An alternative is to use VLOOKUP with the True Option.

    First we need to translate the time into "real" hours. This is done by multiplying it by 24 hours (e.g. 24*A2). Then we can look up on that value.

    I created the table to look up the buckets in columns M and N.

    With the TRUE option, VLOOKUP tries to find an exact match and if it does, it uses that row to look up the data (same as with the FALSE option). If it does NOT find an exact match, it "falls back" to the row associated with the next lowest value.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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] group in ranges in pivot table
    By murthigvs in forum Excel Charting & Pivots
    Replies: 17
    Last Post: 08-12-2017, 05:40 PM
  2. Replies: 2
    Last Post: 09-16-2015, 02:17 AM
  3. group multiple ranges of rows
    By ammartino44 in forum Excel General
    Replies: 0
    Last Post: 06-10-2015, 01:58 PM
  4. How to group time values into ranges?
    By chiccaboom in forum Excel General
    Replies: 1
    Last Post: 02-23-2015, 07:08 PM
  5. Ranges for age group
    By kavithaumasankar in forum Excel General
    Replies: 2
    Last Post: 02-23-2012, 02:17 AM
  6. Replies: 10
    Last Post: 08-28-2009, 11:34 AM
  7. How do I group data using defined ranges?
    By Yenabi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2005, 02:06 PM

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