+ Reply to Thread
Results 1 to 4 of 4

Calculate MIN AVERAGE MAX number of days between two periods/dates

  1. #1
    Registered User
    Join Date
    05-10-2015
    Location
    Ann Arbor
    MS-Off Ver
    M365
    Posts
    83

    Calculate MIN AVERAGE MAX number of days between two periods/dates

    Hello

    I have a dataset of transactions (80K rows). I need to audit to find out the average and maximum number of days elapsing between the intended settlement date - Column G and the Actual settlement date - Column AG. I further want to split this between days elapsing due to Business delays or Customer delays which can be identified in Column AF of the transaction data. MTS represents business delays and EXT represents customer delays.

    Looking at the volume of data (80K rows) I thought of using a pivot table but had issues with presenting the difference in the dates . Any ideas on this will be much appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Calculate MIN AVERAGE MAX number of days between two periods/dates

    Can you create a helper column in the data table that's something like "Settlement Date Difference" that is just "=AG2 - G2" down the whole range? From there, it would be pretty straightforward to create a PT.

    Formulaic builds would also work, but you would be repeating that AG-G calculation a lot, and would probably force you to use all array formulas instead of any SUMIFS/COUNTIFS or whatever, so it would inflate the recalc time in an inefficient way.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  3. #3
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Calculate MIN AVERAGE MAX number of days between two periods/dates

    As Ben mentioned, in AJ2 insert the formula

    =AG2-G2

    Fill that down to the bottom of your data.

    Then in your summary sheet, you can use MAX(IF, MIN(IF and AVERAGE(IF functions to get the results you need. (If you had Excel 2016+ you could use MAXIFS, MINIFS and AVERAGEIFS.) The Excel 2013 versions are array formulas. After you type or edit an array formula you must press CTRL+SHIFT+ENTER to confirm, not just ENTER.

    Examples:

    Summary!F6 (minimum for Business delays):

    =MIN(IF(TransactionData!$B$2:$B$30=$C6,IF(TransactionData!$AF$2:$AF$30="MTS",TransactionData!$AJ$2:$AJ$30)))

    Fill that down to F9.

    Summary!G6 (minimum for customer delays):

    =MIN(IF(TransactionData!$B$2:$B$30=$C6,IF(TransactionData!$AF$2:$AF$30="EXT",TransactionData!$AJ$2:$AJ$30)))

    Fill that down to G9.

    Summary!H6 (average for business delays):

    =AVERAGE(IF(TransactionData!$B$2:$B$30=$C6,IF(TransactionData!$AF$2:$AF$30="MTS",TransactionData!$AJ$2:$AJ$30)))

    Fill down to H9.

    For the MAX functions, use the same formulas you used for MIN and AVERAGE, just replace that word with MAX

    Etc...

    (Note: The average formulas will return a DIV/0 error if no non-zero values exist for those criteria. You can hide these, of course, or adjust the formula to accommodate them.)

  4. #4
    Registered User
    Join Date
    05-10-2015
    Location
    Ann Arbor
    MS-Off Ver
    M365
    Posts
    83

    Re: Calculate MIN AVERAGE MAX number of days between two periods/dates

    Many thanks Guys. I adopted the PT and it works alright.

+ 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. Replies: 7
    Last Post: 12-27-2017, 09:57 AM
  2. How to get an average number of days away from a multitude of dates.
    By GarethEade in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-06-2015, 07:19 AM
  3. Replies: 1
    Last Post: 07-20-2015, 11:40 AM
  4. Average number of days between an array of dates
    By aereit86 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2014, 03:21 PM
  5. Help on count the number of days in between dates and then average number of days
    By Barbara Excel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-30-2013, 12:13 PM
  6. Replies: 2
    Last Post: 10-14-2012, 09:19 AM
  7. Countif and Average function to calculate dates into days
    By codesRus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2012, 04:06 PM

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