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!

Creating an Average from a formula

Status
Not open for further replies.

Oglesbay

Instructor
May 5, 2006
71
0
0
US
I concider myself an average user and am having issues here with this problem. What I am trying to do is to create a report that has an average at the bottom. In the details I am using a formula (say it is [Total Time]) to find the difference in the start time and end time. Then in the report footer I am putting the formula "=AVG([Total Time])". When I put this formula in the report footer I get nothing. If I put it in the page footer, I get an error.

Does anyone have any tips for me to get this to work? Any help would be appreciated. Thanks everyone.
 
Check out the FAQs on creating running sums.
Then average the sum.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Specifically, this FAQ: faq702-5248

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Genomon -

Thanks for your quick reply. However, I am confused as to how a running sum will help when I want an average in my report footer. Maybe I'm just missing the connection here.

Chad
 
Gotta leave soon, so short reply until tomorrow.
The last sum will be a sum total of your data. Put it in a variable & DAvg() it, then assign that value to a text box or label in the footer.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
What about this ?
"=AVG([End Time]-[Start Time])".

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV -

I actually just tried this about 5 minutes before you posted. It worked, but I have a question about it. Wouldn't it really be =AVG([End Time])-AVG([Start Time])?

They both give me an answer, but they are completely different. Thoughts?
 
What do you want:
the average elapsed time (my suggestion)
the difference between the average end time and the average start time (your suggestion, makes no sense IMHO)
 
Well, as you put it that way, you're right...my way is totally wrong! Thanks for your insight!
 
I tried this twice and didn't see a difference:

1. AVG([TotalTime]) where [TotalTime] = [EndTime]-[StartTime]

--> This calculates the average of the time difference so if I have:

TotalTime of 10 seconds, 20 seconds, 30 seconds, my average should be: 20 seconds.

2. AVG([EndTime]) - AVG([StartTime])

--> This calculates the average of all your end time THEN takes away or deducts the average of all your start time.

AVG(60,50,40) - AVG(50,30,10) = 50 - 30 = 20 seconds. Same answer!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top