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
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Sir Vili

Board Regular
Joined
Jul 11, 2002
Messages
148
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.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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.
 

Mark W.

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,654
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,207
Messages
5,594,841
Members
413,944
Latest member
3xc3ln00b

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