Average without Min Max and zero

Glenn_2008

New Member
Joined
Dec 16, 2008
Messages
14
Hi,

I've been using a sumproduct formula to get average without min and max value, but i can't figure out how also to exclude all cells in the same range where i have 0 as a value.

is the formula i use
=SUMPRODUCT((A14:G14<>MAX(P14:AA14))*(A14:G14<>MIN(A14:G14)),A14:G14)/SUMPRODUCT((A14:G14<>MAX(A14:G14))*(A14:G14<>MIN(A14:G14)))

Many thanks for your support.
Glenn
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Hi,

I've been using a sumproduct formula to get average without min and max value, but i can't figure out how also to exclude all cells in the same range where i have 0 as a value.

is the formula i use
=SUMPRODUCT((A14:G14<>MAX(P14:AA14))*(A14:G14<>MIN(A14:G14)),A14:G14)/SUMPRODUCT((A14:G14<>MAX(A14:G14))*(A14:G14<>MIN(A14:G14)))

Many thanks for your support.
Glenn

Excluding 0 values is regarded as mathematically unsound when averaging negative and positive values. That said:

Control+shift+enter, not just enter:

=TRIMMEAN(IF(A14:G14,A14:G14),2/COUNT(1/A14:G14))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,522
Messages
5,837,841
Members
430,518
Latest member
smithk901

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
Top