+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 : Help (again) with AVERAGEIFS formula

  1. #1
    Registered User
    Join Date
    10-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Help (again) with AVERAGEIFS formula

    Hello, I am trying to write two formulae that looks at start and finish dates of investigations and calculates both the average length of time an investigation took to complete and also what percentage of investigations were completed within target.

    For the first formula:
    The start date is in column Q
    The finish date is in column T

    The conditions are that the value in column T must be within the date range 02/01/2012 - 27/01/2012, the value in column F must be "Yes" and both columns Q and T must not be empty.

    The part that is confusing me is adding in the date range for column T


    For the other formula:
    Start date is in column Q
    Finish date is in column T
    Whether or not target was hit (either yes or no) is in column U

    I need to calculate what percentage of values in column Q were "Yes" but only if the value in column T is between 02/01/2012-27/01/2012.

    Once again, it's this date range element that is foxing me.


    Any help is very much appreciated.

    Thank you

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Help (again) with AVERAGEIFS formula

    Try

    =AVERAGEIFS(V2:V20,T2:T20,">=2012-01-02",T2:T20,"<=2012-01-27",U2:U20,"Yes")

  3. #3
    Registered User
    Join Date
    10-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Help (again) with AVERAGEIFS formula

    Thank you, Bob....is this for the first part of my query? Where've you've put reference to column V, should this be column Q? Thank you for helping me!

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Help (again) with AVERAGEIFS formula

    Sorry, I made a bit of a mess of that.

    Try this ARRAY version

    =AVERAGE(IF((T2:T20>=--"2012-01-02")*(T2:T20<=--"2012-01-27")*(F2:F20="Yes"),T2:T20-Q2:Q20))

    Commit with Ctrl-Shift-Enter, not just Enter.

  5. #5
    Registered User
    Join Date
    10-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Help (again) with AVERAGEIFS formula

    Thank you, Bob. So I've tried this and it has given me an answer. I presume this is the average number of days. Do you know how I would adapt this formula to answer the other part of my question? So, what percentage of values in column U are "Yes" if the date range is as before?

    Thank you

  6. #6
    Registered User
    Join Date
    10-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Help (again) with AVERAGEIFS formula

    I've just realised that the formula doesn't include the condition that it must only look at rows where both Q and T have a date in them....

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Help (again) with AVERAGEIFS formula

    Further

    =AVERAGE(IF((Q2:Q20<>"")*(T2:T20<>"")*(T2:T20>=--"2012-01-02")*(T2:T20<=--"2012-01-27")*(F2:F20="Yes"),T2:T20-Q2:Q20))

  8. #8
    Registered User
    Join Date
    10-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Help (again) with AVERAGEIFS formula

    Thank you so much for all your help, Bob. It works perfectly!

    Do you also know how I would do the other part of my query regarding percentage of investigations completed on time?

    So, I need to write a formula that says 'if there are values in Q and T, and the values in T fall within date range 02/01/2012 and 27/01/2012, what percentage of the values in column U are "Yes".

    I appreciate your help with this....it's driving me nuts!

  9. #9
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Help (again) with AVERAGEIFS formula

    I tried to ignore you but you just wouldn't let me would you

    I think this array formula gives you what you want


    =SUM(($T$2:$T$20<>"")*($T$2:$T$20>=--"2012-01-02")*($T$2:$T$20<=--"2012-01-27")*($F$2:$F$20="Yes"))
    /SUM(($T$2:$T$20<>"")*($T$2:$T$20>=--"2012-01-02")*($T$2:$T$20<=--"2012-01-27"))

  10. #10
    Registered User
    Join Date
    10-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Help (again) with AVERAGEIFS formula

    Ha ha.....yes, I'm stalking you but it was worth it as this formula works! Thank you (finally)....

+ 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