Averaging when cells contain blanks or zeros?

liliantsingli

New Member
Joined
Jan 19, 2005
Messages
1
I am trying to average around 50 cells, some of which are either blank or contain zeros. I just want to know the average for the cells that contain numbers. Naturally, If I use =AVERAGE(FI5:HH5) I get the div/0 error. Please can you help me, I have checked the archives to no avail. Thanks in advance.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Welcome!

As you get DIV/0! I guess your numbers are formatted as text.


Try:

=AVERAGE(IF(--FI5:HH5<>0,--FI5:HH5))

Confirmed with Ctrl + Shift + enter.
 

TheToeOfPooh

Active Member
Joined
May 21, 2004
Messages
254
One way you could work around this is to firstly use COUNTIF
to identify cells with contents >0

e.g.using Column "F" Rows 4 to 34 inclusive

In cell F35
=COUNTIF(F4:F34,">=0")

In cell F36
then sum
=SUM(F4:F34)

Then in cell F37
=SUM(F36/F35)

HTH
Bernard
 

Forum statistics

Threads
1,148,216
Messages
5,745,436
Members
423,951
Latest member
peggrif

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