+ Reply to Thread
Results 1 to 6 of 6

Average time duration with multiple instances of the same date

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2013
    Posts
    4

    Average time duration with multiple instances of the same date

    Based on the following sample data, I would like to calculate the average total time, as regards to single dates (not only time duration):
    Date In Out Total Time
    Wed 09/09/2015 09:00 17:00 08:00
    Thu 10/09/2015 09:00 11:00 02:00
    Thu 10/09/2015 11:00 14:00 03:00
    Thu 10/09/2015 14:00 17:00 03:00
    Fri 11/09/2015 09:00 17:00 08:00
    Sat 12/09/2015 09:00 17:00 08:00
    Average 05:20

    The current formula that calculates the average in cell "D8", which needs to be modified, is
    Please Login or Register  to view this content.
    The result should be 08:00.
    Is it possible to avoid using VBA or adding any columns to calculate totals per date prior calculating the average?
    The MS Excel version is 2007.

    The spreadsheet can be downloaded here:
    example.xls

    Any help???

  2. #2
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague
    MS-Off Ver
    Excel 2013
    Posts
    161

    Re: Average time duration with multiple instances of the same date

    try with this:

    =SUM(D2:D10)/(SUMPRODUCT(($A$2:$A$10<>"")/COUNTIF($A$2:$A$10,$A$2:$A$10&"")))

  3. #3
    Registered User
    Join Date
    06-15-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Average time duration with multiple instances of the same date

    Unfortunately, it doesn't provide the correct results. I attach a revised file with more records:
    example2.xls

    "AVERAGE2" formula gives a result based on your suggestion, simultaneously with excel's AVERAGE formula.
    You could try seeing if they both match when all records exist and/or when you delete the duration on Sep. 11th, which has multiple durations.
    Last edited by tsthanos; 09-14-2015 at 07:42 AM.

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague
    MS-Off Ver
    Excel 2013
    Posts
    161

    Re: Average time duration with multiple instances of the same date

    try with this one:

    =SUM($D$2:$D$22)/SUM(IF(FREQUENCY(A2:A22, A2:A22)>0,1))

    I've test it with split time per day and total time per day (in AVERAGE 2). It gives correct result.

    test.xls

  5. #5
    Registered User
    Join Date
    06-15-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Average time duration with multiple instances of the same date

    Thank you for the prompt reply!
    The formula results in correct average values.

    However, how it could be modified in order to ignore records in case a date (column A) exists without the corresponding time duration? (a)

    In addition, since there is currently no "AVERAGE" function, how could the "MIN" and "MAX" results be figured out using similar formulas? (b)

    A revised version of the sample spreadsheet (AVERAGE value matches your suggested formula, while MIN and MAX currently use standard MS Excel formulas):
    example3.xls
    Last edited by tsthanos; 09-15-2015 at 02:42 AM.

  6. #6
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague
    MS-Off Ver
    Excel 2013
    Posts
    161

    Re: Average time duration with multiple instances of the same date

    To be honest, I have no idea how you could have formula to ignore the blank, or to have Min and Max.
    I would suggest to try with pivot table. It will give you automatically sum per date (ignoring blanks), and it will be easier to find the min and max value from that.

    test - pivot.xls

+ 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. auto fill-in current date/time and duration
    By aturetsky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2013, 02:19 PM
  2. Replies: 0
    Last Post: 10-17-2013, 03:09 PM
  3. [SOLVED] Date and Time duration formula
    By tep1981 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-17-2013, 03:16 AM
  4. Calculating duration with strange date / time format
    By chrispx001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2013, 11:08 AM
  5. Weeks left in a month after a certain date for a certain duration of time
    By mknapp21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2012, 03:34 PM
  6. Replies: 2
    Last Post: 10-07-2010, 09:27 PM
  7. Date/time Duration
    By zjay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2005, 06:06 AM

Tags for this Thread

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