Average of the 5 best numbers out of 6 in a range?

obiwann

Board Regular
Joined
Jan 2, 2014
Messages
142
Can someone help with a formula to find out the Average of the 5 best numbers out of 6 in a range?
I know you need to find the farthest number from the mean of the 6.
A1 = 1.00105
A2 = 1.00116
A3 = 1.00177
A4 = 1.00096
A5 = 1.00108
A6 = 1.00098
 
This will do it,

2 formula choices for new average
You don't need D2 (farthest) if you don't want it.

Book3.xlsx
ABCDE
11.00105Result>># farthestaverage best 5
21.001161.001771.001046
31.001771.001046
41.00096
51.00108
61.00098
Sheet945
Cell Formulas
RangeFormula
D2D2=IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6))
E2E2=AVERAGEIF(A1:A6,"<>"&IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6)),A1:A6)
E3E3=(SUM(A1:A6)-IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6)))/5
That works great! One more question, Instead of the final step of finding the average of the best 5 numbers how would I incorporate into you formula finding the repeatability of the 5 best numbers.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
That works great! One more question, Instead of the final step of finding the average of the best 5 numbers how would I incorporate into you formula finding the repeatability of the 5 best numbers.

I don't understand what you mean, can you explain clearly.
 
Upvote 0
This should give you the "repeatability" value for the 5 best values:

Book1
ABCDEF
11.00105Result>># farthestaverage best 5Repeatability
21.001161.001771.001046
31.001771.0010460.000199808
41.00096
51.00108
61.00098
Sheet2
Cell Formulas
RangeFormula
D2D2=IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6))
E2E2=AVERAGEIF(A1:A6,"<>"&IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6)),A1:A6)
E3E3=SUM(A1:A6,-D2)/(COUNT(A1:A6)-1)
F3F3=PRODUCT(AGGREGATE({14,15},6,A1:A6/(A1:A6<>D2),1)^{1,-1})-1


Also, I got .000809 using your formula for repeatability for all 6 values, not .0167. I'm not sure why we're different.
 
Last edited:
Upvote 0
The formula starts by making an array of the 6 numbers (A1:A6). It then divides by (A1:A6<>D2), meaning that the outlier value becomes a #DIV/0! error. The 6 parameter in AGGREGATE means to ignore errors, so the outlier is ignored. The 14 parameter means LARGE, and the 15 parameter means SMALL. So in combination with the final 1 parameter, AGGREGATE returns a 2-element array, the first element being the largest value from the array, and the second element being the smallest value. Then we raise the two values to the power of {1,-1} respectively, giving the original largest number, and the reciprocal of the smallest number, then PRODUCT multiplies those together, and finally we subtract 1 from the result. This should be equivalent to the formula you showed in post 13.
 
Upvote 0
This should give you the "repeatability" value for the 5 best values:

Book1
ABCDEF
11.00105Result>># farthestaverage best 5Repeatability
21.001161.001771.001046
31.001771.0010460.000199808
41.00096
51.00108
61.00098
Sheet2
Cell Formulas
RangeFormula
D2D2=IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6))
E2E2=AVERAGEIF(A1:A6,"<>"&IF(MAX(A1:A6)-AVERAGE(A1:A6)>AVERAGE(A1:A6)-MIN(A1:A6),MAX(A1:A6),MIN(A1:A6)),A1:A6)
E3E3=SUM(A1:A6,-D2)/(COUNT(A1:A6)-1)
F3F3=PRODUCT(AGGREGATE({14,15},6,A1:A6/(A1:A6<>D2),1)^{1,-1})-1


Also, I got .000809 using your formula for repeatability for all 6 values, not .0167. I'm not sure why we're different.
How would I nest this into one formula?
 
Upvote 0
If you really wanted, you could just put the D2 formula in the F2 formula. But after thinking about it a bit more, this should work and is shorter:

Excel Formula:
=MIN(LARGE(A1:A6,{1,2})/SMALL(A1:A6,{2,1}))-1
 
Upvote 0
Solution
If you really wanted, you could just put the D2 formula in the F2 formula. But after thinking about it a bit more, this should work and is shorter:

Excel Formula:
=MIN(LARGE(A1:A6,{1,2})/SMALL(A1:A6,{2,1}))-1
Wow! That works great. Thank you everyone!
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
Latest member
Arbind kumar

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