+ Reply to Thread
Results 1 to 10 of 10

how to re-divide the data at the same time interval

  1. #1
    Registered User
    Join Date
    04-18-2009
    Location
    oh, usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    how to re-divide the data at the same time interval

    I have 2 columns of data (value and time):

    for example:

    15 4/2/08 13:00
    4 4/2/08 19:00
    7 4/5/08 12:00
    13 4/9/08 3:00

    They are continuous data. so I want to divid the value into hourly data as follows.

    15 4/2/08 13:00
    ? 4/2/08 14:00
    ? 4/2/08 15:00
    . .
    . .
    ? 4/9/08 2:00
    13 4/9/09 3:00



    Is there any way I could do it?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to re-divide the data at the same time interval

    yes but date/ times are difficult to match, something to do with excels rounding.
    with your data in column a and b with headers in column d cell d2 put your first date time say 1/31/2008 00:00
    then in the cell below put the next increment
    1/31/2008 01:00
    select both and drag down
    this will give you steps of one hour
    now in column c cell c2 put this array formula
    =INDEX($A$2:$B$500,MATCH(TEXT(D2,"mm/dd/yyyy hh:mm"),TEXT($B$2:$B$500,"mm/dd/yyyy hh:mm"),0),1)
    click on formula in formula bar and do ctrl+shift+enter at the same time
    {} will appear around it so it looks like this
    {=INDEX($A$2:$B$500,MATCH(TEXT(D2,"mm/dd/yyyy hh:mm"),TEXT($B$2:$B$500,"mm/dd/yyyy hh:mm"),0),1))}
    drag this formula down as far as required


    if you dont want to see a loaD of #N/A
    USE
    =IF(ISNA( MATCH(TEXT(D2,"mm/dd/yyyy hh:mm"),TEXT($B$2:$B$500,"mm/dd/yyyy hh:mm"),0)),"", INDEX($A$2:$B$500,MATCH(TEXT(D2,"mm/dd/yyyy hh:mm"),TEXT($B$2:$B$500,"mm/dd/yyyy hh:mm"),0),1))
    again entered with ctrl+shift+enter
    Last edited by martindwilson; 04-18-2009 at 06:12 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: how to re-divide the data at the same time interval

    I guess you could set the first time (D2) to be the MIN of Column B

    D2: =MIN(B:B)

    Then D3 onwards

    D3: =D2+"01:00:00"
    copied down

    Then you could use LOOKUP in C

    C2: =LOOKUP(D2+"00:00:01",B:B,A:A)
    copied down as far as required

    Pending volume of rows you're talking about it may make more sense to use VBA ?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607
    wrong idea : )

  5. #5
    Registered User
    Join Date
    04-18-2009
    Location
    oh, usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    dived the value at the same time interval

    I think my question posted earlier was misunderstood, so I decide to post it more clearly again to see if there's help.

    If I have 4 sets of data (value, time) with a linear relationship between each value as follows:

    4 4/2/08 7:00
    12 4/2/08 11:00
    3 4/2/08 14:00
    11 4/2/08 16:00

    what formula can I use to change the data above into the hourly data like below:

    4 4/2/08 7:00
    6 4/2/08 8:00
    8 4/2/08 9:00
    10 4/2/08 10:00

    12 4/2/08 11:00
    9 4/2/08 12:00
    6 4/2/08 13:00

    3 4/2/08 14:00
    7 4/2/08 15:00
    11 4/2/08 16:00

    Thanks for the help!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to re-divide the data at the same time interval

    Threads merged.

    There's no need to start a new thread; just provide a better explanation and continue.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to re-divide the data at the same time interval

    just for future use can you or anyone if giving dates use examples of days >12 as i for one often mistake 7/8 for 8/7 and its not clear what is wanted

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to re-divide the data at the same time interval

    the example i posted will give
    Please Login or Register  to view this content.
    now how you fill in the missing values is a different matter

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

    Re: how to re-divide the data at the same time interval

    There must be a better way but based on my interpretation:
    Attached Files Attached Files

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to re-divide the data at the same time interval

    now thats better!

+ 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