+ Reply to Thread
Results 1 to 8 of 8

Finding average value between percentiles

  1. #1
    Registered User
    Join Date
    08-10-2017
    Location
    NY
    MS-Off Ver
    2016
    Posts
    6

    Finding average value between percentiles

    Hi folks,

    I have a data set where I'm trying to find the average value per quintile and some of the values aren't uniform. To get the average value for the top and bottom quintile, I did
    Formula 1.PNG


    but this doesn't work if I try to get the value between quintiles:

    Formula 2.PNG

    Any thoughts on how I could fix that second formula to get the correct average value between the 40th and 60th percentiles?

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Finding average value between percentiles

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-10-2017
    Location
    NY
    MS-Off Ver
    2016
    Posts
    6

    Re: Finding average value between percentiles

    Sorry, I cannot upload files from this computer

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Finding average value between percentiles

    I can't see your data layout, so I can't help.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Finding average value between percentiles

    A few clarifications:

    1) Your "working" formula that your text suggests is computing the average of the top quintile appears to be computing the average of the bottom 4 quintiles (everything but the top quintile). Your description of the non-working formula suggests that you are trying to find the average of each quintile, but the formula appears to be trying to get the average of everything but the 3rd quintile. It is not clear to me which you are trying to do (though I would assume the text is correct and that the formulas are in error).

    2) Is there a reason you are avoiding the AVERAGEIFS() function (for backwards compatibility to pre2003 perhaps)? I think the AVERAGEIFS() function would be easier if you are allowed to use it (https://support.office.com/en-us/art...8-f7c5c3001690 ).

    Assuming that your text description is the accurate description (you are trying to find the average of each quintile, I would proceed like this:

    1) Enter 0, 0.2, 0.4, etc. in a suitable column (if DO3:DO8 is available, maybe there).
    2) Enter a formula like =AVERAGEIFS($DN$3:$DN$150,$DN$3:$DN$15,">="&PERCENTILE($DN$3:$DN$150,DO3),$DN$3:$DN$150,"<"&PERCENTILE($DN$3:$DN$150,DO4)) a cell adjacent to the percentiles (maybe DP3). Note the mix of relative and absolute references.
    2a) If you really don't like having the percentiles in DO, you can hard code those values into each copy of the formula and omit step 1.
    2b) The same thing can be accomplished using your AVERAGE(IF(...)) structure, you just need to think through the IF(...) logic better. Let us know if this is necessary.
    3) Copy DP3 and paste in DP4:DP7
    4) Adjust the formula in DP7 so that it includes the max value in the average (adjust the final criteria so it is "<=" instead of just "<").

    Is that helpful at all?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    08-10-2017
    Location
    NY
    MS-Off Ver
    2016
    Posts
    6

    Re: Finding average value between percentiles

    This was great and sorry for the unclear wording! You are 100% right -- I am trying to find the average value per quintile.

    Just one thing -- I'm running into #VALUE! when using the formula above because in that range (DN3:DN150) there are values that are 0 or errors. That's why in the first formula, I included the term "#" after the range. How would I address this issue using the AVERAGEIFS function you so kindly provided above?

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Finding average value between percentiles

    If DN contains errors, that suggests that DN contains a formula, in which case, I would probably deal with the errors in DN in DN (probably using the IFERROR() function https://support.office.com/en-us/art...6-63f3e417f611 ). Something like =IFERROR(current formula in DN,"#"). If you take care of the errors in DN, then your AVERAGEIFS() formula does not need to deal with the errors (and I am not sure how to add a "include in average if not error" criteria to AVERAGEIFS())

    You also mention that you have 0 values in DN, which neither my formula handles nor do your formulas. This can be handled by the AVERAGEIFS() function by including a third criteria_range and criteria argument where the criteria is "<>0". Or, you could also handle this error in DN. IFERROR(IF(current formula in DN=0,current formula in DN,"#"),"#"). Note that this means computing the current formula in DN twice, which could become a performance concern if the current formula in DN is "slow" (like a "linear" exact match lookup function).
    Last edited by MrShorty; 08-11-2017 at 02:20 PM. Reason: entered IF() function where I intended IFERROR() function

  8. #8
    Registered User
    Join Date
    08-10-2017
    Location
    NY
    MS-Off Ver
    2016
    Posts
    6

    Re: Finding average value between percentiles

    Thank you!

+ 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: 6
    Last Post: 07-17-2014, 03:08 AM
  2. Finding 25%, 50%, and 75% Percentiles
    By maliotta in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-12-2014, 03:53 PM
  3. [SOLVED] Average excluding percentiles (top/bottom nth percent)
    By ker9 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-13-2014, 04:34 PM
  4. Finding Average
    By JezLisle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-27-2009, 10:47 AM
  5. Finding an Average
    By dmay1102 in forum Excel General
    Replies: 11
    Last Post: 07-09-2008, 02:36 PM
  6. formulate tests scores then average them as percentiles in excel
    By David Pruden in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-17-2006, 02:10 PM
  7. [SOLVED] percentiles?-How does excel calculates the percentiles worksheet function?
    By Agnes Goris in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-14-2005, 11:05 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