+ Reply to Thread
Results 1 to 9 of 9

AVERAGEIF - Account for DIV/0, #NA and dynamic range

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    9

    AVERAGEIF - Account for DIV/0, #NA and dynamic range

    I would really appreciate some help with this. The attached spreadsheet has a thorough explanation of the problems I am having with creating these formulas. It calculates improvement in the weekly results of occupational therapy.
    I have to create summary averages that can handle DIV/0 and #NA. The range of the formulas is dynamic ---- there is always a Week 1 but may or may not be a Week 3 or 4 result. Need to calculate % improvement from the 1st week to the last week the patient was seen (could be 2 weeks only).
    I have a thousand words in this picture (at least) ---- attached is self explanatory.

    I thought I had this solved once before but alas I did not. I tried to account for calculations that started in week 1 with a zero by using .0001 instead that drove the % Improvement way up and distorts the summary improvement.
    Please see attached.
    Thanks for the help.
    Dave@ExpSC
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,528

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    I'm not entirely sure I understand your logic. If you start at one level, get worse and then get better ... and possibly better again ... surely you should base your calculations on the initial value and the final value, regardless of the intermediate values? Conversely, if you started at 75, increased to 120, and then dropped to 50, your maximum would be 120 and the minimum 50 ... but the actual decrease in performance would be 25, bearing no relation to the 70 you calculate.

    It's important to be clear on the approach before you try to define the formula

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-24-2014
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    You are correct. That is how it is supposed to work ---- improvement(or back slide)based on the initial value as compared to the final value regardless of how the patient does in between. I am challenged the fact that the final value is dynamic. Appreciate you taking the time to look at it and helping if you can.
    Dave@ExpSC

  4. #4
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    This will give you the results you need for the Flex data and accounts for loss then improvement, or improvement then loss, constant improvement, or constant loss.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It will also mean the average in I15 doesn't have errors to contend with.

    With the Ext data how do you want to reflect somebody who starts at 0 and ends at 3? Compared to somebody who starts at 0 and ends at 2?

  5. #5
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    More questions:
    If somebody starts off at 12 Ext and gets to 0 (row 23) that is a 100% improvement. If somebody starts at 1 and ends at 0 that is also a 100% improvement. Are they equivalent?

    Is the %age improvement per patient that critical, or is it just a vehicle to get the average improvement?

  6. #6
    Registered User
    Join Date
    03-24-2014
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    It's a good and valid question. I would go with primarily a vehicle to track Summary % Improvement.
    Thanks
    Dave@ExpSC

  7. #7
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    Does this work for you then?
    OT Improvement.xlsx

    I have changed the percentage of Ext to the total movement in column N and the percentage in N15 is the total movement/total week 1.

  8. #8
    Registered User
    Join Date
    03-24-2014
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    Wow - you are certainly good at this. These are a fantastic solution. I sincerely and greatly appreciate your solution to my post.
    Many many thanks,
    Dave@ExpSC

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,528

    Re: AVERAGEIF - Account for DIV/0, #NA and dynamic range

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. [SOLVED] Remove an account range form a column with account numbers.
    By kokapelly in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-09-2013, 11:34 AM
  2. [SOLVED] Averageif(range,monthcriteria,[average range])???
    By athyeh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-19-2013, 12:09 PM
  3. Using averageif with dynamic range
    By davetcw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2013, 07:17 PM
  4. [SOLVED] averageif for date range
    By tbaron in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2013, 07:48 PM
  5. Replies: 1
    Last Post: 09-07-2012, 12:00 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