473,509 Members | 3,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Average by .25

I know there is an equation to come up with this but I can't think of
it.

I have to enter 3 different measurements an example below:

15.25
15.25
15.00

I need this to return the average of the three like this 15.25

I used the following but I get the average of the sum:

([ab1] + [ab2] + [ab3])/3 this will equal 15.17

I need it to return 15.25 It's probably a min/max function but I need
some help

Thanks

Nov 13 '05 #1
3 1158
Are you trying to find the Median (value of the middle item in the list) or
the Mode (the value that repeats most often)?

--
Wayne Morgan
MS Access MVP
<dm******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I know there is an equation to come up with this but I can't think of
it.

I have to enter 3 different measurements an example below:

15.25
15.25
15.00

I need this to return the average of the three like this 15.25

I used the following but I get the average of the sum:

([ab1] + [ab2] + [ab3])/3 this will equal 15.17

I need it to return 15.25 It's probably a min/max function but I need
some help

Thanks

Nov 13 '05 #2
There's some great stuff in this NG if you search for it...

original post:
This should do it, just put .50 as the ToWhat parameter.

Function RoundIt (RoundMe,ToWhat)
RoundIt = (Int(RoundMe / ToWhat + .5) * ToWhat)
End Function

Ron Knapper
Newsgroups: comp.databases.ms-access
From: r...@aol.com (Ron R K)
Date: 1996/01/30
Subject: Re: Rounding a dollar value

Nov 13 '05 #3
Thanks all I already found it.

Function RoundToNearest(dblNumber As Double, varRoundAmount As Double,
_
Optional varUp As Variant) As Double

Dim dblTemp As Double
Dim lngTemp As Long

dblTemp = dblNumber / varRoundAmount
lngTemp = CLng(dblTemp)

If lngTemp = dblTemp Then
RoundToNearest = dblNumber
Else
If IsMissing(varUp) Then
' round down
dblTemp = lngTemp
Else
' round up
dblTemp = lngTemp + 1
End If
RoundToNearest = dblTemp * varRoundAmount
End If
End Function
I call it in a function from a query. Thanks again

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4382
by: Sara | last post by:
I am trying to find the average number of products of the set that is on rows...dynamically. For example, if I had states on rows and was looking at the average number of products, I would see...
2
2789
by: Karen | last post by:
I inserted this statement and it worked great for the customers that have no payment history, but for the customers that have a history and an open invoice, it still used today's date in the mix...
6
3129
by: J | last post by:
Kind of new at programming/vb.net. I'm doing this junky die roller program. Heres's what is supposed to happen: Roll 2 6-sided dies. Add rolls together put total in rolls(d6total). Display...
4
3390
by: Gary | last post by:
Hi, I have a temperature conversion program down pat, but I was told to add an average, meaning, i need to get the average temperature for as many times as it was entered. i do not know where to...
3
2301
by: C++Geek | last post by:
I need to get this program to average the salaries. What am I doing wrong? //Program to read in employee data and calculate the average salaries of the emplyees.
3
4475
by: simpleeshelbee | last post by:
Hey guys, This is my second post and is URGENT!!!! My final assignment is due tonite for class and I have no idea how to write this program right! I am supposed to write a program that uses a...
3
4127
by: mochatrpl | last post by:
I am looking for a way to make a query / report display the running average for total dollars. I have already set up a query to provide totals dollars per day from which a report graphly shows...
3
5292
by: Salad | last post by:
http://www.mathwords.com/w/weighted_average.htm At the above link gives an example of a weighted average. It uses the following example: Grades are often computed using a weighted average....
3
1986
by: vileoxidation | last post by:
Hello, and thanks for any help in advance! Basically, as the title says, I am looking for a way to print the number of times the user gave the program an input, and then also print the average of...
5
3156
by: p3rk3le | last post by:
So, I'm about to do a sequential search on a table (n contents) of random numbers. I have to print the average between the number of comparisons and the contents of the table (n) and the...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.