Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Geometric Mean Problem

Status
Not open for further replies.

Ray1127

Programmer
Feb 22, 2002
231
0
0
US
I have a report that calculates the Date Difference between 2 dates. For each Group the report has to calculate the Arithmetic Mean of that calculation and the Geometric Mean. The Arithmetic Mean is working fine but I'm having an issue with the Geometric Mean. As I understand it the Geometric mean is the following:

The Product of the date Diff Calculation ^ (1/Count of Records)

Nothing I've tried calculates this successfully anybody have an Idea???
 
The simplest solution would be to see if you have any zeroes or negatives mucking up your results.

However that leads us to the real question; how do you know you aren't getting the right results? If you tell us maybe we can figure it out. Are you truthing it by hand or with Excel?

Go ahead and post Crystal version info just in case, of course.

(The negatives are killer because a geometric mean assumes you have no negatives, and a zero would throw your product all the way to zero before the exponentiation. Also, your date diff calculation can result in a negative number but that would be meaningless in this case, so you would want to absolute value it.)

Maybe you could post some data and what you expect to get, and what you are getting instead. Perhaps at least one of the formulas you've tried as well.

Scott.
 
Thanks, I had found that Many of the dates in the calculation were for the same day so there were too many zero's that was the issue. After discussion with the primary user If the dates were the same that was 1 day so by Adding 1 to the Datediff calculation that solved the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top