geometric mean

accessuser1023

Registered User.
Local time
Today, 14:33
Joined
Nov 12, 2012
Messages
71
does anyone know a couple of equivalent pieces of mathematics to get to this in Access? Here is a link that explains a little bit about it:

http://timothychenallen.blogspot.com/2006/03/sql-calculating-geometric-mean-geomean.html

However, I'm having a problem with summing an entire field. Access does not have a DProduct() function, so it makes the math of "taking the Nth root of a product of 'X' numbers" kind of impossible without writing a custom function.

has anyone run across this before? I realize that this doesn't belong in Access, but none-the-less that is what I have.
 
I'd recommend reading the entire article ... until the very last line :D
 
Your link already has some suggestions so I don't understand the point of the question.

Have you tried to use Access and if so do you get an overflow.
 
Here is sample code which should help you

Code:
Sub geomean()
'
Dim ar(4) As Double '0-4  5 storage locations
Dim av As Double
 ar(0) = 5
 ar(1) = 7
 ar(2) = 55
 ar(3) = 6
 ar(4) = 3
For i = 0 To 4  ' 5 numbers in the sample
 Debug.Print Log(ar(i)); ar(i)  'Display interim values
 av = av + Log(ar(i)) 'natural log
Next i

av = Exp(av / 5)  '  e** (avg/ 5)
MsgBox "Geometric mean  of these 5 numbers is " & av
End Sub
 
Last edited:
Here is sample code which should help you

Code:
Sub geomean()
'
Dim ar(4) As Double '0-4  5 storage locations
Dim av As Double
 ar(0) = 5
 ar(1) = 7
 ar(2) = 55
 ar(3) = 6
 ar(4) = 3
For i = 0 To 4  ' 5 numbers in the sample
 Debug.Print Log(ar(i)); ar(i)  'Display interim values
 av = av + Log(ar(i)) 'natural log
Next i

av = Exp(av / 5)  '  e** (avg/ 5)
MsgBox "Geometric mean  of these 5 numbers is " & av
End Sub

this is incredibly useful. Although I was prepared to write a function. For the rest of you, the reason I posted this was because I was on information overload. And of course using Access as a statistical program doesn't help either. But you get paid for what you can get, and you go with the impossibilities sometimes guys.
 

Users who are viewing this thread

Back
Top Bottom