Disregard 0 in an average calc

MRomanow

New Member
Joined
Mar 10, 2005
Messages
46
I have 14 cells that I paste in numbers from another program. I then have a formula that calculates the average of these 14 numbers. Sometimes the numbers that I copy and paste include a few zeros in them. How can I get the average calculation to disregard these zeros?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
use

=AVERAGE(IF(range,range))

confirmed with CTRL+SHIFT+ENTER

or with just ENTER

=SUM(range)/SUMPRODUCT(--(range<>0))
 
Upvote 0

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Try

=AVERAGE(IF(A1:A10<>0,A1:A10,FALSE))

Confirmed with CTRL+SHIFT+ENTER, not just Enter

Adjust range to suit.
 
Upvote 0

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,526
Hi,

an alternative without using [Ctl-Shift-enter] is
=SUM(A1:A10)/COUNTIF(A1:A10,"<>0")
 
Upvote 0

Forum statistics

Threads
1,196,008
Messages
6,012,836
Members
441,733
Latest member
MartijnB

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