restate: find out the average number

randomwalker

Board Regular
Joined
Feb 22, 2007
Messages
169
Hi,

cell c1 = aaa, c2=aa, c3=aaa, c4=a, c5=aa, ..., c18=aa.
d1 = 20, d2=83, d3=60, ...

Now I want to find out the mean of some numbers in column D. Those numbers are higher than the 10% percentile and lower than the 90% percentile, meanwhile the level in the corresponding cells in column c is "aaa". my formula is {=AVERAGE(IF($C$1:$C$18="aaa",IF($D$1:$D$18>PERCENTILE($D$1:$D$18,10%),
IF($D$1:$D$18 <percentile($D$1:$D$18,90%),$d$1:$d$18))))}.

but it doesn't work correctly. the formula above simply gives the average of those numbers in column d with "aaa" in column c, it overlooks the 10% percentile and 90% percentile function.

where am I wrong?

thanks for help!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Your formula works for me using xl10. I can't see any reason why it doesn't work for you

Excel Workbook
CDE
2aaa2
3w3
4e4
5r5
6aaa6
7q2
8w3
9aaa3
10aaa5
11aaa12
12s7
13
144.666667
15
162
177
Sheet3
 
Upvote 0
Confirmed using Excel 2007 as well. Are you sure that there are values for aaa that are outside the 10th to 90th percentile boundaries?
 
Upvote 0
Hi konew1

what I want to get is the average of the numbers between 10% of those "aaa" numbers and 90% of those "aaa" numbers. Use your data set as an example, the 10% percentile of those "aaa" number = 2.4, the 90% percentile of those "aaa" numbers = 9.6. That's to say I want to get the average of the numbers larger than 2.4 but lower than 9.6. In your dataset, those numbers are 3,6,5 and the average = 4.6667.

but if change the "aaa" numbers to 12, 24, 3, 5, 18, you'll find the result is 8.50 if use the formula and the result is 11.667 if you calculate manually.
the 10% of the "aaa" numbers = 3.8; the 90% of the "aaa" numbers = 21.6, therefore the numbers that I am looking for are 12, 5, 18 and the mean of these numbers is 11.667.

seems there is something wrong in the formula, any idea?

thanks
 
Upvote 0
So you want to use the percentile just based on the numbers coded aaa? Definitely more challenging...working on it now.
 
Upvote 0
Hi,

cell c1 = aaa, c2=aa, c3=aaa, c4=a, c5=aa, ..., c18=aa.
d1 = 20, d2=83, d3=60, ...

Now I want to find out the mean of some numbers in column D. Those numbers are higher than the 10% percentile and lower than the 90% percentile, meanwhile the level in the corresponding cells in column c is "aaa". my formula is {=AVERAGE(IF($C$1:$C$18="aaa",IF($D$1:$D$18>PERCENTILE($D$1:$D$18,10%),
IF($D$1:$D$18 <percentile($D$1:$d$18,90%),$d$1:$d$18))))}.

but it doesn't work correctly. the formula above simply gives the average of those numbers in column d with "aaa" in column c, it overlooks the 10% percentile and 90% percentile function.

where am I wrong?

thanks for help!

Hi konew1

what I want to get is the average of the numbers between 10% of those "aaa" numbers and 90% of those "aaa" numbers. Use your data set as an example, the 10% percentile of those "aaa" number = 2.4, the 90% percentile of those "aaa" numbers = 9.6. That's to say I want to get the average of the numbers larger than 2.4 but lower than 9.6. In your dataset, those numbers are 3,6,5 and the average = 4.6667.

but if change the "aaa" numbers to 12, 24, 3, 5, 18, you'll find the result is 8.50 if use the formula and the result is 11.667 if you calculate manually.
the 10% of the "aaa" numbers = 3.8; the 90% of the "aaa" numbers = 21.6, therefore the numbers that I am looking for are 12, 5, 18 and the mean of these numbers is 11.667.

seems there is something wrong in the formula, any idea?

thanks

So you want to use the percentile just based on the numbers coded aaa? Definitely more challenging...working on it now.

Control+shift+enter, not just enter:
Rich (BB code):
=AVERAGE(IF($C$2:$C$12="aaa",
  IF($D$2:$D$12>PERCENTILE(IF($C$2:$C$12="aaa",$D$2:$D$12),10%),
  IF($D$2:$D$12 < PERCENTILE(IF($C$2:$C$12="aaa",$D$2:$D$12),90%),
  $D$2:$D$12))))

</percentile($D$1:$d$18,90%),$d$1:$d$18))))}.
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,453
Members
449,161
Latest member
NHOJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top