Non-zero Average

Markscozz

New Member
Joined
Mar 18, 2002
Messages
4
Does anyone know how to calculate the average of a range of numbers, excluding zeros?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
On 2002-03-19 14:18, Markscozz wrote:
Does anyone know how to calculate the average of a range of numbers, excluding zeros?

{=AVERAGE(IF(A1:A5,A1:A5))}

Note: This is an array formula which must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.
 
Upvote 0
On 2002-03-19 14:18, Markscozz wrote:
Does anyone know how to calculate the average of a range of numbers, excluding zeros?

There are a few formulas for computing the average of non-zero values in a range:

=SUM(A1:A9)/MAX(1,COUNTIF(A1:A9,">0")+COUNTIF(A1:A9,"<0"))

to propose my preferred formula.

Aladin
 
Upvote 0
On 2002-03-19 14:24, Aladin Akyurek wrote:
On 2002-03-19 14:18, Markscozz wrote:
Does anyone know how to calculate the average of a range of numbers, excluding zeros?

There are a few formulas for computing the average of non-zero values in a range:

=SUM(A1:A9)/MAX(1,COUNTIF(A1:A9,">0")+COUNTIF(A1:A9,"<0"))

to propose my preferred formula.

Aladin

You might be able to shorten this just a little and still preserve the dreaded text problem with

=SUM(A1:A9)/MAX(1,COUNT(A1:A9)-COUNTIF(A1:A9,0))

Over this course of a lifetime, this could save you say, 30 seconds. :wink:
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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