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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accurately Calculating Average and Median 1

Status
Not open for further replies.

akirk

Technical User
Mar 28, 2002
27
US
Trying to compare the overall average and median of a field in my report to the average for one of the groups.

Field is # of months, and the data has been grouped by a group called Aging into two values fresh and aged. I want to calculate the average and median number of months for just the Fresh group, and display it in a chart along with the average and median values for the entire report.

The calculations work in the Aging group footer, but don't when I try to use them in the report footer.

The problem comes when I try the following syntax:

if aging = "Fresh" then # of Months

This puts a zero in rows where the aging value is not Fresh, and these are included in the calculation, when I don't want them. I can see that the sum would still work correctly, but the average and median functions do not.

How to build a formula for median and average that only takes the rows from the Fresh group into consideration?

FWIW--I am using crystal XI

Thanks

kirk

 
Have you tried Running Totals? They can do medians etc. and can also exclude records using a formula.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks, I was able to get the data I needed with the running totals!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top