Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default PERCENTRANK in array formula: strange behavior

Hi all,

I was trying to help an OP with a problem involving PERCENTRANK. We
wanted to compute the average of those numbers in a dataset with
percentile between 60% and 95%. The suggested formula was:

=AVERAGE(IF(AND(PERCENTRANK(A1:A10,A1:A10)0.6,PER CENTRANK(A1:A10,A1:A10)<0.95),A1:A10))

This one returns #N/A if A1:A10 is empty and 0 if it is non-empty. The
docs for PERCENTRANK do not mention #N/A as possible return value and
neither do for AVERAGE. Yet it might make sense for an empty data set.
The 0 though I cannot explain. I tried various versions involving N(),
just in case, like:

=AVERAGE(IF(AND(PERCENTRANK(N(A1:A10),N(A1:A10))0 .6,PERCENTRANK(N(A1:A10),N(A1:A10))<0.95),N(A1:A10 )))

Still no luck. If I break it down to auxiliary columns and w/o array
formulas it works:

In column B:B:
=PERCENTRANK($A$1:$A$10,A1)
In column C:C
=IF(AND(PERCENTRANK($A$1:$A$10,A1)0.6,PERCENTRANK ($A$1:$A$10,A1)<0.95),A1)

In a separate cell:
=AVERAGE(C1:C10)

Any explanation? I am baffled. Far more complex formulas have worked in
the past.

Regards,
Kostis Vezerides

  #2   Report Post  
Posted to microsoft.public.excel.misc
Domenic
 
Posts: n/a
Default PERCENTRANK in array formula: strange behavior

The AND function doesn't work with arrays. It returns a single value.
Try the following instead...

=AVERAGE(IF(PERCENTRANK(A1:A10,A1:A10)0.6,IF(PERC ENTRANK(A1:A10,A1:A10)<
0.95,A1:A10)))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

In article . com,
"vezerid" wrote:

Hi all,

I was trying to help an OP with a problem involving PERCENTRANK. We
wanted to compute the average of those numbers in a dataset with
percentile between 60% and 95%. The suggested formula was:

=AVERAGE(IF(AND(PERCENTRANK(A1:A10,A1:A10)0.6,PER CENTRANK(A1:A10,A1:A10)<0.95
),A1:A10))

This one returns #N/A if A1:A10 is empty and 0 if it is non-empty. The
docs for PERCENTRANK do not mention #N/A as possible return value and
neither do for AVERAGE. Yet it might make sense for an empty data set.
The 0 though I cannot explain. I tried various versions involving N(),
just in case, like:

=AVERAGE(IF(AND(PERCENTRANK(N(A1:A10),N(A1:A10))0 .6,PERCENTRANK(N(A1:A10),N(A
1:A10))<0.95),N(A1:A10)))

Still no luck. If I break it down to auxiliary columns and w/o array
formulas it works:

In column B:B:
=PERCENTRANK($A$1:$A$10,A1)
In column C:C
=IF(AND(PERCENTRANK($A$1:$A$10,A1)0.6,PERCENTRANK ($A$1:$A$10,A1)<0.95),A1)

In a separate cell:
=AVERAGE(C1:C10)

Any explanation? I am baffled. Far more complex formulas have worked in
the past.

Regards,
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default PERCENTRANK in array formula: strange behavior

It helps a lot!

Thank you Domenic, I can't believe this detail had slipped my
attention. In the past I had found workarounds but had not clarified it
in myself that I cannot use it in array formulas. And of course I
neglected using the infix notation, which in this case replaces AND
perfectly:

=AVERAGE(IF((PERCENTRANK(A1:A10,A1:A10)0.6)*(PERC ENTRANK(A1:A10,A1:A10)<0.95),A1:A10))

Regards

Kostis

PS. I always look upon your posts with great interest. Your formulas
taught me a lot in aspects of Excel I had not had the chance to work
with prior to joining these groups systematically

  #4   Report Post  
Posted to microsoft.public.excel.misc
Domenic
 
Posts: n/a
Default PERCENTRANK in array formula: strange behavior

In article .com,
"vezerid" wrote:

Thank you Domenic,


You're very welcome, Kostis!

I can't believe this detail had slipped my
attention.


When I first started, I ran into the same thing... :)

PS. I always look upon your posts with great interest. Your formulas
taught me a lot in aspects of Excel I had not had the chance to work
with prior to joining these groups systematically


Yes, these newsgroups are great. I continue to learning something new
everyday... :)

Cheers!
  #5   Report Post  
Posted to microsoft.public.excel.misc
Kimmerz321
 
Posts: n/a
Default PERCENTRANK in array formula: strange behavior


Dredging this up.......

I need to take the average of a range of numbers if they're in a
certain percentile, I.E in the 90th to 99th Percentile. I tried using
the formula below, but Excel errors out on the PercentRank function -
it seems that it doesn't like that I'm giving it two arrays instead of
an array and a value as directed by the specs. I get a #VALUE error.
Here is the formula I am using:


=AVERAGE(IF(PERCENTRANK(B1031:B1530,B1031:B1530)0 .9,IF(PERCENTRANK(B1031:B1530,B1031:B1530)<0.99,B1 031:B1530)))

Suggestions? Am I using too large of a range?

Thanks, Kim


--
Kimmerz321
------------------------------------------------------------------------
Kimmerz321's Profile: http://www.excelforum.com/member.php...o&userid=24105
View this thread: http://www.excelforum.com/showthread...hreadid=513955



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array Formula Not Working with Range with Formulas [email protected] Excel Discussion (Misc queries) 4 February 1st 06 02:01 PM
Array Formula Problem rmolitor Excel Worksheet Functions 4 December 2nd 05 06:35 PM
Array formula returning wrong results TUNGANA KURMA RAJU Excel Discussion (Misc queries) 1 November 19th 05 10:29 AM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM
What instead of an array formula part 2 Reg Besseling Excel Discussion (Misc queries) 2 December 10th 04 07:35 AM


All times are GMT +1. The time now is 05:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"