Coorect way to average

Folks,
In A1:A10 there are 8 values (2,4,6,8,10,12,14,16) and 2 cells with zero in each.
The average should be 9. The average I'm getting is 7.2. How does one average with zero value(s) that you do no want to be included in the average
Frank FreeseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

duttcomCommented:
Try this -

=AVERAGEIF(A1:A10,">0")
0
Peter HartCommented:
you can use

=AVERAGEIF( A1:A10 , "<>0")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Peter HartCommented:
duttcom you beat me by 1.20 :-(  but mine allows for not zero i.e. minus ;-)
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

JohnBusiness Consultant (Owner)Commented:
If the cells are mathematically and legitimately zero then the average is 7.2. That is just standard mathematics.

If the cells are not relevant and just there then the formula provided above is what you need.
0
duttcomCommented:
Ah- but you used "<>0" which is more correct if there are going to be negative values!
0
Frank FreeseAuthor Commented:
John,
You'd be correct if zero was part of the data stream. In this instance zero simply means that there was nothing in a particular month which would not would not be out of the ordinary.
I'd forgot that a negative value needs to be included. Although duttcome had a great solution, I'm going to go with chilternPC on this one.
0
Frank FreeseAuthor Commented:
thanks to all
0
duttcomCommented:
No assist points? Oh well...
0
Frank FreeseAuthor Commented:
Assist point? Did not know we could give assist points. I do now - thanks for letting me know.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.