Average Formula without counting zeros or max or min

ShanaVT

Board Regular
Joined
May 12, 2010
Messages
86
I want to create a formula that takes the average of a set of values but throws out the highest value and lowest value and does not consider zeros. Any ideas?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
A solution by using the SUMPRODUCT function :
=SUMPRODUCT((range<>MAX(range))*(range<>MIN(range))*(range<>0)*range)/SUMPRODUCT((range<>MAX(range))*(range<>MIN(range))*(range<>0))
 
Upvote 0
I want to create a formula that takes the average of a set of values but throws out the highest value and lowest value and does not consider zeros. Any ideas?

Control+shift+enter, not just enter:

Either...

=TRIMMEAN(IF(A2:A7,A2:A7),2/SUM(IF(A2:A7,1)))

Or...

=AVERAGE(IF(A2:A7,IF(1-(A2:A7=MAX(A2:A7)),IF(1-(A2:A7=MIN(A2:A7)),A2:A7))))

whichever is appropriate.
 
Upvote 0

Forum statistics

Threads
1,203,472
Messages
6,055,610
Members
444,803
Latest member
retrorocket129

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