I need to round numbers in Access to the nearest integer, where I'd round up

if .5 or greater else round down. For example, need to round 33.5 to 34 and

33.2 to 33. I do not want to simply change the properties of the field...I

want the actual rounded number to populate the cell. Thanks!

Renee:

Have you tried using the Round function? It takes two parameters, the value

and the number of decimals places to round to. The default is zero decimal

places (an integer).

--

David Lloyd

MCSD .NET

http://www.yqcomputer.com/

This response is supplied "as is" without any representations or warranties.

I need to round numbers in Access to the nearest integer, where I'd round up

if .5 or greater else round down. For example, need to round 33.5 to 34 and

33.2 to 33. I do not want to simply change the properties of the field...I

want the actual rounded number to populate the cell. Thanks!

Have you tried using the Round function? It takes two parameters, the value

and the number of decimals places to round to. The default is zero decimal

places (an integer).

--

David Lloyd

MCSD .NET

http://www.yqcomputer.com/

This response is supplied "as is" without any representations or warranties.

I need to round numbers in Access to the nearest integer, where I'd round up

if .5 or greater else round down. For example, need to round 33.5 to 34 and

33.2 to 33. I do not want to simply change the properties of the field...I

want the actual rounded number to populate the cell. Thanks!

Hay Renee

You can also use the function round, it might be better

round(MyNumber)

You can also use the function round, it might be better

round(MyNumber)

Use the Integer function -

Syntax: INT(number) Rounds a number down to the nearest integer.

Number is the real number you want to round down to an integer.

Example

Data = 19.5

Formula Description (Result)

=INT(8.9) Rounds 8.9 down (8)

=INT(-8.9) Rounds -8.9 down (-9)

=A2-INT(A2) Returns the decimal part of a positive real number in cell A2

(0.5)

Syntax: INT(number) Rounds a number down to the nearest integer.

Number is the real number you want to round down to an integer.

Example

Data = 19.5

Formula Description (Result)

=INT(8.9) Rounds 8.9 down (8)

=INT(-8.9) Rounds -8.9 down (-9)

=A2-INT(A2) Returns the decimal part of a positive real number in cell A2

(0.5)

If you incorporate a bit of elementary maths and use INT(number+0.5) it will

always round to the nearest integer. For gimmicky supermarket 'rounding

down' change the 0.5 to fit the store's exact criteria.

Alan

always round to the nearest integer. For gimmicky supermarket 'rounding

down' change the 0.5 to fit the store's exact criteria.

Alan

Neither the "Round" function nor the "Format" function will do what the

original poster requested, that is:

round up if .5 or greater, else round down.

For example, need to round 33.5 to 34 and 33.2 to 33

Both of your solutions--and those of most everyone else responding to this

type of a problem--will round 33.5 to 33 NOT 34.

Does anyone else know how to round numbers UP which have .5 or greater in

the number AND round DOWN those which have less than .5 in their number??

Thanks

original poster requested, that is:

round up if .5 or greater, else round down.

For example, need to round 33.5 to 34 and 33.2 to 33

Both of your solutions--and those of most everyone else responding to this

type of a problem--will round 33.5 to 33 NOT 34.

Does anyone else know how to round numbers UP which have .5 or greater in

the number AND round DOWN those which have less than .5 in their number??

Thanks

Here's a potential solution I found by searching on-line:

Question: I read your explanation of the Round function using the

round-to-even logic. However, I really need to round some values in the

traditional sense (where 5 always rounds up). How can I do this?

Answer: You could always use the following logic:

If you wanted to round 12.65 to 1 decimal place in the traditional sense

(where 12.65 rounded to 1 decimal place is 12.7, instead of 12.6), try

adding 0.000001 to your number before applying the Round function:

Round(12.45+0.000001,1)

By adding the 0.000001, the expression that you are rounding will end in

1, instead of 5...causing the Round function to round in the traditional

way.

And the 0.000001 does not significantly affect the value of your

expression so you shouldn't introduce any calculation errors.

Good luck!

Regards

Jeff Boyce

Microsoft Office/Access MVP

Question: I read your explanation of the Round function using the

round-to-even logic. However, I really need to round some values in the

traditional sense (where 5 always rounds up). How can I do this?

Answer: You could always use the following logic:

If you wanted to round 12.65 to 1 decimal place in the traditional sense

(where 12.65 rounded to 1 decimal place is 12.7, instead of 12.6), try

adding 0.000001 to your number before applying the Round function:

Round(12.45+0.000001,1)

By adding the 0.000001, the expression that you are rounding will end in

1, instead of 5...causing the Round function to round in the traditional

way.

And the 0.000001 does not significantly affect the value of your

expression so you shouldn't introduce any calculation errors.

Good luck!

Regards

Jeff Boyce

Microsoft Office/Access MVP

1. Rounding to nearest integer

2. Round up to nearest 'odd' integer

3. HOW TO ROUND UP INTEGER VALUES TO NEAREST TENS EXAMPLE 376 TO 380

4. rounding numbers to NEAREST odd integer?

5. round number to nearest integer.

6. In Dev-C++, how can I make a rounding to nearest integer?

7. Rounding -- was [PHP] round to nearest 500?

8. I need a formula with rounding up & rounding down to the nearest .

9. Rounding to the nearest Thousand in Access

10. formula in an access field to round an invoice value to nearest ?0c or ?5c.

11. How do you round to the next integer in Access 2000?

12. dynamic dictionaries w/ ins, del, and nearest neighbor

13. Decimals Constant to 0.50 or Nearest Integer

14. How to roundoff the decimal points to the nearest whole integer?

15. Microsoft Access 2000 - Why are the add-ins greyed out after ins

9 post • Page:**1** of **1**