+ Reply to Thread
Results 1 to 7 of 7

Dividing data into bins and calculating the averages

  1. #1
    Registered User
    Join Date
    05-04-2008
    Posts
    2

    Dividing data into bins and calculating the averages

    Hi everyone,

    I have huge amount of data with me. I have speeds of vehicles generated at random times(for 24 hrs) in a column. Now I need to divide the data into bins of 300 secs (5 mins) and calculate the average value of speeds for every bin.

    The problem I am facing is that the bin size varies from time to time due to randomness in data. So this makes it difficult to the application of a single formula to calculate the average of speeds for vehicles in a particular bin. I can do this manually by seeing the times and calculating the average for every 5 min interval, but it would take a lot of time as the dat is huge.

    Can anyone please let me know the procedure to do this?

    Thanks
    sashi

    PS: please let me know if the question is not clear

  2. #2
    Registered User
    Join Date
    05-04-2008
    Posts
    2

    Dividing data into bins and calculating the averages

    Hi everyone,

    I have huge amount of data with me. I have speeds of vehicles generated at random times(for 24 hrs) in a column. Now I need to divide the data into bins of 300 secs (5 mins) and calculate the average value of speeds for every bin.

    The problem I am facing is that the bin size varies from time to time due to randomness in data. So this makes it difficult to the application of a single formula to calculate the average of speeds for vehicles in a particular bin. I can do this manually by seeing the times and calculating the average for every 5 min interval, but it would take a lot of time as the dat is huge.

    Can anyone please let me know the procedure to do this?

    Thanks
    sashi

    PS: please let me know if the question is not clear

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Post some data (like 20 minutes worth) and I or someone else will provide a formula.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Threads merged.

    sashi, please read the Forum Rules, and don't post the same thread in two forums.

  5. #5
    Forum Contributor
    Join Date
    01-05-2004
    Location
    Helsinki, Finland
    Posts
    100
    Hi Sashi,

    you could try this approach. Name the area where the times are as "time" and the area where speeds are as "speed". Both areas has to have exactly the same amount of rows (as I assume, that you have).

    Now make the bins. In my example I have 0:00:00 in G2, 0:00:05 in G3 and so on until G290 where I have 0:00:00 again.

    Now put this formula in H2 and copy it all the way down to H289:

    Please Login or Register  to view this content.
    Hope this helps.

    - Asser

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Or, using Jazzer's layout and an array formula,

    =AVERAGE(IF( (time>=G2) * (time < G3), speed) )

    I think the second relation should be "<" rather than "<=" to avoid counting the same speed in two time periods.

  7. #7
    Registered User
    Join Date
    11-09-2012
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Dividing data into bins and calculating the averages

    will this work with version 2003?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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