+ Reply to Thread
Results 1 to 9 of 9

Calculation data within two different times

  1. #1
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Calculation data within two different times

    Here a puzzle for any expert out there, and the answer needs to be simple ..lol

    The situation

    Im measuring arrivals of buses during a two hour period, for example 10 til 12
    Within in this time i have 12 buses.

    The Problem

    What i need to do is calculate how many buses have turned up in a "rolling hour". This means taking a sample of any 60 mins within the two hours and calculating how many buses turn up. There needs to be a min of 6 buses in that 60 mins

    In theoy there would be 60 "rolling hours" within a two hour period.

    For example first 60 min is 10 till 11, second 60 min is 10:01 till 11:01 and so on.

    So i need to calculate out of the 60 rolling hours how many of those hours had six buses and how many didn't

    I hope some one can help...PLEASE

    I hope i have explained this in a simple way, if not just ask and i can try and explain it better .. lol
    Last edited by drgogo; 02-04-2009 at 11:28 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculation data within two different times

    If you could post a file with some sample data and outline where and how you want to display results that would be a good starting point.

    Thanks,

  3. #3
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Calculation data within two different times

    Please find attached an example and description of what the problem is. Due to circumstances beyond my control i can attach actual spreadsheet with data, So i have taken screen shots and tried to explain what i am looking for.

    I have zipped the word document

    I hope someone can help me

    Gareth
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-20-2008
    Location
    US
    MS-Off Ver
    Excel 2007, Student Version
    Posts
    33

    Re: Calculation data within two different times

    Excel 2007 (sorry...govt regs)
    Table, Shifting Range
    http://www.mediafire.com/file/zk2yywimyky/01_27_09.xlsx
    Last edited by herbds7; 01-28-2009 at 01:11 PM. Reason: Added more conditional formatting

  5. #5
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Calculation data within two different times

    Thanks for that..
    But I am running Excel 2003, I have managed to view it on Excel 2003, but the table has only a few entries and then there is a name error in all other cells.

    Cant work out what the error is...

    Sorted out error, just a few questions thou

    Why only 9 Rolls and 15 Rows.

    I can see how it is working, but there are 60 rolling hours, so im a bit confused ..??

    Can you help

    Gareth
    Last edited by drgogo; 01-28-2009 at 04:37 PM.

  6. #6
    Registered User
    Join Date
    12-20-2008
    Location
    US
    MS-Off Ver
    Excel 2007, Student Version
    Posts
    33

    Re: Calculation data within two different times

    MS provides a free Excel 2007 trial version.
    I am using many features only found in '07.
    Almost impossible to convert my layout into '03.
    You will get #Name? errors if the Data Analysis Add-In is not installed.
    The number of Rolls depends on the average gap length that I assumed.
    Only few rows shown since there are much less than 60 unique rolling hours.
    Expand/shrink rows/columns as your real data demands.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculation data within two different times

    Gareth, per your PM I have tried to come up with something for you.

    My problem is I'm not sure how/where you were hoping to do the calculations... ie were you analysing a given table in detail or trying to return the results to say 2 cells (v. difficult using formulae -- easier with UDF)

    Based on native formulae & analysis of a given timeframe in full I came up with the attached... not very elegant however and moreover I'm not convinced it's what you're trying to achieve.

    On 'Frequent Service' sheet I added an additional column to create a Key based on Date / Location & Start Time... this makes subsequent calculations a little easier.

    I created a 2nd sheet called 'Frequent Service Analysis' on which you would alter the following cells:

    Please Login or Register  to view this content.
    So if you wanted to analyse a subsequent table you would alter the above cells accordingly.

    The subsequent table would then list the 60 periods and the results - ie count of buses and count of > 15 min intervals (based on Actual time column (ie value in I falls within period boundaries and J exceeds threshold))

    It's very difficult to know what you want given you don't offer an expected results section... I appreciate it's difficult re: uploading files but it is equally difficult & time consuming for us to try and replicate your screen shots so as to generate a sample.

    If you want the above condensed into 2 cells (ie one for count of periods where count of buses > 6 and another to hold late count) then let us know... but to reiterate I think VBA would be required to ease the pain so we need to know that (VBA) is viable before pursuing further.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    01-29-2008
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    237

    Re: Calculation data within two different times

    Thanks, it work brilliantly...

    The other stuff i can work out myself

    Only one question, is that when i change the time in B3, the times displayed in the rolling hours dont change, they stay the same, I know the results will be the same, but its a bit confusing when you have a Start time of lest say 10:25, but the 60 rolling hour table starts at 10:00am

    But good work...

    Gareth

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculation data within two different times

    Change B7 on Analysis sheet to:

    =$B$3+TIME(0,$A7-1,0)

    copy down for remaining rows

+ 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