Geomean #NUM! error

kckay

Board Regular
Joined
Nov 8, 2010
Messages
134
I have Excel 2007.

I am using geomean to calculate monthly fecal-e. coli values at a waste water treatment plant. The sample frequency is 1-2 samples weekly. There 8 samples in the month of May. These values range from 0 to 120. May 1 is G135; May 31 is G165. With the exception of the header, the G column is numeric with decimal count 0.

The geomean formula I am using is =GEOMEAN(G135:G165). The format of the geomean field is numeric with 2-pt decimal count.

I get the result #NUM! error.

Thank you for assisting me.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You cannot calculate a geometric mean with data that includes 0. Maybe this array entered formula

=GEOMEAN(IF(G135:G165<>0,G135:G165))

confirmed with CTRL + Shift + Enter. However, this result will be positively biassed.
 
Upvote 0
Wouldn't AVERAGE be a more relevant metric? The zeros are certainly significant, and shouldn't be ignored.
 
Upvote 0
Removing the 0 value within the record count allowed the geomean to operate correctly.

The CO state regulations indicate 2 ways of calculating the fecal coliform bacteria concentrations:
1) (a*b*c*d*....) to the (1/n) power
OR
2) antilog([log(a)+log(b)+log(c)+log(d)+...]/n

The zero is an actual count; no sample or test is indicated by an empty cell.
 
Upvote 0
The State regulations appear to be flawed since either of those will result in errors or incorrect results.
 
Upvote 0
Amen.

You could have zeros all year, and one bad day would have the same result as a year of bad days.
 
Upvote 0
Agreed - politicians writing reg's!

An executive decision has been handed down that when a zero value is encountered, a 1 shall be utilized in the report and spreadsheet.

I really appreciate the help.
 
Upvote 0
One is a random number; you could equally choose 42 or 5*10-12. If the unit of measurement was percent, 1 would be an awful number.

Water treatment analysis has been around long enough that I'd bet there is a more thought-out method.

Or perhaps readings of zero never occur in practice, and your measurements are either bad or insufficiently sensitive.

Either way, setting them to a random value is papering over the fecal problem. :biggrin:
 
Upvote 0
This subject of fecal coliform counts definitely leaves open lots of room for humor - and I really get a kick from your inputs.

Reg's are reg's. Remember, the government knows best. :laugh:

Now, along those lines: Crap-in, Crap-out. I would like to put a test or filter on each cell (or column if possible) to change a 0 value to a 1 when the user enters the data.

It is a fix to deal with one set of users, but it will be useful for all of the users throught he state.

Thanks.
 
Upvote 0
This can be done but I would caution against this since it could be interpreted as falsifying results and it will distort any metric.

Right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
    Application.EnableEvents = False
    If Target.Value = 0 Then
        Target.Value = 1
    End If
    Application.EnableEvents = True
End If
End Sub

But, don't do it!
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,735
Members
452,939
Latest member
WCrawford

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