+ Reply to Thread
Results 1 to 7 of 7

Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

  1. #1
    Registered User
    Join Date
    06-01-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    3

    Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    Hi, I need to aggregate the time data (mm/dd/yyyy:hh:mm:ss) into an hourly range.

    So, basically if I have ~16 observation for 2 days, I want to aggregate them into a 3 hours range window and count the number of observations in each range (of 3 hours). Example is given below. Thank you very much in advance.


    Raw Data 3 hour range Count
    09/08/2013:23:46:41 09/08/2013:03:00:00 0
    09/08/2013:23:50:19 09/08/2013:06:00:00 0
    09/08/2013:23:50:46 09/08/2013:09:00:00 0
    09/09/2013:00:27:04 09/08/2013:12:00:00 0
    09/09/2013:00:45:20 09/08/2013:15:00:00 0
    09/09/2013:00:45:21 09/08/2013:18:00:00 0
    09/09/2013:00:45:21 09/08/2013:21:00:00 0
    09/09/2013:00:45:21 09/08/2013:24:00:00 3
    09/09/2013:00:45:21 09/09/2013:03:00:00 13
    09/09/2013:00:45:21 09/09/2013:06:00:00 0
    09/09/2013:00:45:21
    09/09/2013:00:45:21
    09/09/2013:00:45:21
    09/09/2013:00:45:21
    09/09/2013:00:45:21
    09/09/2013:00:45:21
    Last edited by Trader1011; 09-20-2013 at 03:00 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    The function you need is "frequency" and the bin values need to be 3 hourly time segments..
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    06-01-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    Thanks for the reply. I did try the Frequency function in excel. However, the function returns #N/A.

    I have attached the spreadsheet with the thread.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    Date & Time separator is ":" in your data. It must be 'space'. I used SUBSTITUTE to replace first ":" to 'space'

    In C2, with CTRL+SHIFT+ENTER

    =FREQUENCY(SUBSTITUTE(A$2:A$17,":"," ",1)+0,SUBSTITUTE(B2,":"," ",1)+0)-SUM(C$1:C1)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    I think that this is what you are looking for:
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Registered User
    Join Date
    06-01-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    Hi newdoverman, Haseeb & AndyLitch,

    Thank you very much for your replies. I was able to get the correct count for the hourly range.

    Thanks once again.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Aggregate the time data (mm/dd/yyyy:hh:mm:ss) into the 3 hours range

    Thanks for the feedback

+ 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] Timesheet that calcs time in, time out, lunch used, reg hours, ot hours, double hours
    By noobface in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-21-2021, 03:45 AM
  2. Aggregate data in a range of columns to remove blank cells
    By arbgd1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2013, 04:11 PM
  3. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  4. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  5. Copy+Paste macro dd/mm/yyyy to dd/mm/yyyy and NOT dd/mm/yyyy to mm/dd/yyyy
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2012, 03:45 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