How to set up a formula using the average and if functions

penguinT

New Member
Joined
Sep 18, 2002
Messages
1
I am trying to do a simple formula where I want to average a row of percentages without it counting the zeros. I thought that if I had it AVERAGEIF all numbers were greater than 0 it would work. For some reason, I cannot make it work for me. Some of the cells in the row are linked to other worksheets which fills the cell with text data. Does this have something to do with it not working? I get either a NAME error or VALUE error. I have tried turning off the zero in the options menu; that doesn't help either. Please help. Thank you in advance. penguinT
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hello penguinT.

Lets us assume, that Your data is on area B2:B9. Use Formula:

=AVERAGE(IF(B2:B9<>0,B2:B9))

When You write this formula, do not push Enter, but instead CTRL + SHIFT + ENTER. Excel adds in beginning { and at end }. So You need ARRAY Formula.

Hopes this helps You.

BRGDS Sir Vili.
 
Upvote 0
Let A1:A10 be the range of interest.

The following ordinary formula


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

will also give you the desired average.
 
Upvote 0
On 2002-09-19 09:37, Sir Vili wrote:
...Use Formula:

=AVERAGE(IF(B2:B9<>0,B2:B9))

Since the IF worksheet functions treats 0 values as FALSE there's no need to compare each value to 0.
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,174
Members
449,071
Latest member
cdnMech

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