# Average Returns a Div/0 error

#### antsaresocrazy

##### New Member
i tried searching for this, but couldn't find a good explanation for my particular problem. All the others involve simple averaging, but nothing that excludes zeros. I tried pasting my formula in place of the simple averages but excel does not approve. And because most of the answers I've looked at don't have explanations, I can't reason my way any closer...

I am using excel 2008 on my mac, and I'm trying to create an average that only includes numbers that are greater than zero. (Its a spreadsheet for finances, so I don't want to include the future months in my average.)

The average is working correctly, as long as there is at least one number there. However, if there are no numbers in any field, then I'm getting the Div/0 error. I wouldn't care so much, except that there are other formulas that are dependent on that one, and those sums all return the Div/0 error.

Here is a screen shot of what I've got going on. The monthly values are pulled from separate monthly input tabs.

The Formula in the "Average" column, and the top row is

=(SUM(B14:M14))/(COUNTIF(B14:M14,">0"))

This Formula works perfectly, and so does the next one down. Is there a way I can change my formula to return a dash or on the third row down?

I've been working with this for a bit and I can't seem to figure out the proper sequence or something...

John

### Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi John,

I can't seem to see the screenshot you've attached but at first glance at this the =IFERROR formula should be your friend here.

If you stick your formula within that you can dictate what to display when there is no data in the cells thus giving a div/0 error.

=IFERROR((SUM(B14:M14))/(COUNTIF(B14:M14,">0")),"Insert alternative here")

If you simply want a 0 when there is no data then don't enter an argument for the value if error.

Any questions let me know.

Replies
8
Views
148
Replies
3
Views
143
Replies
6
Views
578
Replies
6
Views
572
Replies
3
Views
54

1,196,323
Messages
6,014,643
Members
441,834
Latest member
GHOSTOF309

### 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?

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