+ Reply to Thread
Results 1 to 6 of 6

How do you add a dynamic reference in a percentrank formula?

  1. #1
    Registered User
    Join Date
    08-05-2016
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    18

    Smile How do you add a dynamic reference in a percentrank formula?

    Hello lovely people of excel forum,

    Please can someone help me with this excel problem? I am sure it is an easy fix, but I cannot fathom it. I have added a fake data set to illustrate my point.

    I want to percentrank the mean score (column E), per data in column D (category). If there was the same number of rows per category, I think I could solve it; however, the number of rows differs per category. Thus, I need to somehow make the part of the formula that references the specific area in column E dynamic i.e. in the formula below, I need to replace the ‘E$2:E$18’ bit with something that uses column D to define its upper/lower limits.

    =(PERCENTRANK(E$2:E$18,E2))*100


    Penny for your thoughts, excel gurus.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How do you add a dynamic reference in a percentrank formula?

    Try

    =(PERCENTRANK(OFFSET(E$2,MATCH($C2,$C$2:$C$100,0)-1,0,COUNTIFS($C$2:$C$100,$C2,$A$2:$A$100,$A2),1),E2))*100

  3. #3
    Registered User
    Join Date
    08-05-2016
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    18

    Re: How do you add a dynamic reference in a percentrank formula?

    Sir JohnTopley, you are a hero amongst men - thank you!

    Any chance you can explain how it works? Now worries if not, you have already done me a huge favour!

    Thank you.

  4. #4
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: How do you add a dynamic reference in a percentrank formula?

    I think that this formula will do it
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How do you add a dynamic reference in a percentrank formula?

    (PERCENTRANK(OFFSET(E$2,MATCH($C2,$C$2:$C$100,0)-1,0,COUNTIFS($C$2:$C$100,$C2,$A$2:$A$100,$A2),1),E2))*100

    The OFFSET function is based on E$2 as a fixed starting cell.

    The MATCH function finds the FIRST row which matches the INDICATOR (Column C) and we subtract 1 to get the starting row of our required range.

    The COUNTIFS counts the number of occurrences of PROGRAM and INDICATOR which gives the number of rows (Height in OFFSET) to be included in our range.


    FYI: The COUNTIFS could be changed to COUNTIF($D$2:$D$100,$D2) i.e use your CATEGORY column.



    To see this working, select F2==>Formulas=>Evaluate Formula==>Evaluate

    Hope this helps.

  6. #6
    Registered User
    Join Date
    08-05-2016
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    18

    Re: How do you add a dynamic reference in a percentrank formula?

    Thank you for the other suggestion, Roger Govier. I ended up making a combination of the two suggestions to fit my needs. Excellent.

    JohnTopley - thank you for taking the time to break that down for me - very helpful. Much appreciated.

+ 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] Replace a cell reference in a formula with dynamic reference
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2016, 11:04 AM
  2. PERCENTRANK formula to exclude zeros?
    By tsiguy96 in forum Excel General
    Replies: 1
    Last Post: 05-28-2014, 09:16 AM
  3. [SOLVED] PERCENTRANK Entire Column via Array Formula
    By Chip4Pips in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-28-2013, 02:33 PM
  4. Dynamic range to use in percentrank formula
    By bagar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2013, 12:56 AM
  5. [SOLVED] PERCENTRANK in array formula: strange behavior
    By vezerid in forum Excel General
    Replies: 4
    Last Post: 03-09-2006, 12:11 PM
  6. what is the underlying formula for the percentrank function
    By geff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-11-2006, 03:45 PM
  7. what is the underlying formula for the percentrank function
    By geff in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-11-2006, 01:45 PM

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