Consulting

Results 1 to 7 of 7

Thread: Solved: Percentrank :CSE

  1. #1
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location

    Solved: Percentrank :CSE

    Is it possible to use Percentrank as a CSE function.

    I have something like this:
    =PERCENTRANK(IF($D$3:$D$30=$D$31,TRUNC($C$3:$C$30,2),FALSE),$C$31)

    Where $D$3:$D$30=$D$31 is the condition to be evaluated, and TRUNC($C$3:$C$30,2) would be returned.

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,877
    Yes
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location
    I keep getting a #N/A. Would a file help..?

  4. #4
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location
    Am attaching a sanitized file. Still not being able to crack this one...

    Cell C33 has the function I have put. Basically I want to be able to choose the metric2 in D31, and only the PercentRank for values with that metric2 should be evaluated.

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    TRy this

    =PERCENTRANK(IF($D$3:$D$30=$D$31,TRUNC($C$3:$C$30,2),99^99),$C$31)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,877
    That's because, in your file, the 0.56 is higher than any value for Metric for any row with the Metric2 of 'B'.
    From Help:
    • If x does not match one of the values in array, PERCENTRANK interpolates to return the correct percentage rank.
    So in this case there's no match, but also nothing to interpolate.
    Either change the 0.56 to a lower value (probably silly), or (more likely to be useful) include the 0.56 in the formula:
    =PERCENTRANK(IF($D$3:$D$31=$D$31,TRUNC($C$3:$C$31,2),FALSE),$C$31)
    when you get a sensible answer of 1 or 100%
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  7. #7
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location
    ^^
    yes, worked. Thanks to you and XLD for the suggestions....!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •