+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Calculate times between a date range and other categories...

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    Tampa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Calculate times between a date range and other categories...

    I have attached the file I am working with.

    The basic of what I need to do is take the data from Sheet2 and have it total on Sheet1.

    Where it get's complex however is that I need that data to be pulled only when certain criteria are met.

    So let me try and explain:

    You will notice RAW data on Sheet 2, which includes a Date, Position, Block, Live Sim, Non-Pos.

    On Sheet1 I need to pull the RAW data from Sheet2 and calculate it in the appropriate blocks after meeting the correct criteria.

    So cell B9 on Sheet1 would need to contain the total LIVE hours from Sheet2 within the date range of 27 May-29 May and I would like for it to determine that by 2 criterias (Date, Block) When those three criterias from Sheet2 match it should total it there.

    Then cell D9 would operate the same way, but would total the entire LIVE hours from the LIVE column of Sheet2.

    Then B12 would be the total of B9:11 and D12 would be the total of D9:11.

    The times need to stay in an hour+minute format such as 1+45 or 1:45 for 1 hour 45 minutes.

    Any help would be greatly appreciated.
    Attached Files Attached Files

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

    Re: Calculate times between a date range and other categories...

    Given use of XL2007 you should make use of the SUMIFS function, eg:

    B9:
    =SUMIFS(Sheet2!$C$2:$C$6,Sheet2!$A$2:$A$6,">="&$D$2,Sheet2!$A$2:$A$6,"<="&$E$2,Sheet2!$B$2:$B$6,$C$2)

    Apply a custom format to B9 (etc) of [hh]:mm:ss

    (Note you specify 27 -> 29th yet file imples 27 - 30th - if the end date is meant to be first day to be excluded change <= to < in the above)

    Modify ranges as appropriate of course.

    For more info. on SUMIFS see XL Help (and/or Google)

  3. #3
    Registered User
    Join Date
    06-22-2010
    Location
    Tampa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Calculate times between a date range and other categories...

    For us simple minded people, you sir are a GENIUS!!

    Thank you very very much!!!

  4. #4
    Registered User
    Join Date
    06-22-2010
    Location
    Tampa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Calculate times between a date range and other categories...

    I am trying to edit a new critera and can't figure it out.

    I need B18 to calculate =sum(B6+B17+B15) if C2 = I and if C2 = II then I need B18 to enter the same cell data as E18???

    Thanks again for any help....

    (it's embedded in Word since it's what I will be using it in eventually.)
    Attached Files Attached Files
    Last edited by Boozshey; 07-10-2010 at 09:50 PM.

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

    Re: Calculate times between a date range and other categories...

    =if(c2="I",SUM(B6,B17,B15),IF(C2="II",E18,0))
    "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

+ 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