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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,598
Messages
6,120,441
Members
448,966
Latest member
DannyC96

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