# SolvedROUNDUP NUMBERS (1 Viewer)

#### hatmak

##### Registered User.
hi all

in excel to get round up number

like 325 ------ use roundup to do it like 330

how do it in access QUERY

iTEM Count

A 305 ------.> ROUND UP TO 310

B 209-------. ROUNDUP TO 210

#### Attachments

• ROUNDUP_ACCESS.accdb
484 KB · Views: 29

#### arnelgp

##### ..forever waiting... waiting for jellybean!
use Ceiling() function:

'https://www.tek-tips.com/faqs.cfm?fid=5031
Public Function Ceiling(ByVal X As Double, Optional ByVal Factor As Double = 1) As Double
' X is the value you want to round
' is the multiple to which you want to round
Ceiling = (Int(X / Factor) - (X / Factor - Int(X / Factor) > 0)) * Factor
End Function

?ceiling(305, 10)
?celing(209, 10)

#### hatmak

##### Registered User.
could you please add to my example

it not work with me

regards

see Module 1.
see your query.

#### Attachments

• ROUNDUP_ACCESS.accdb
520 KB · Views: 41

#### ByteMyzer

##### AWF VIP
use Ceiling() function:

'https://www.tek-tips.com/faqs.cfm?fid=5031
Public Function Ceiling(ByVal X As Double, Optional ByVal Factor As Double = 1) As Double
' X is the value you want to round
' is the multiple to which you want to round
Ceiling = (Int(X / Factor) - (X / Factor - Int(X / Factor) > 0)) * Factor
End Function

?ceiling(305, 10)
?celing(209, 10)
Hello, @arnelgp,

Thank you for the reference to my code (wow, that was a long time ago!)

I have since simplified it to the following:
Code:
``````Public Function Ceiling(ByVal number As Double, ByVal significance As Double) As Double
Ceiling = Int(number / -significance) * -significance
End Function

Public Function Floor(ByVal number As Double, ByVal significance As Double) As Double
Floor = Int(number / significance) * significance
End Function``````

#### hatmak

##### Registered User.
many thanks arnelgp

#### Gasman

##### Enthusiastic Amateur
could you please add to my example

it not work with me

regards
How can it not work for you?, it is just a few lines of code?

#### isladogs

##### CID VIP
Crossposted at UtterAccess.com where Gustav Brock suggested what is essentially the same solution to ByteMyzer.
This is for use in a query, specifically rounding up to the nearest 10

Code:
``-Int(-[YourField] / 10) * 10 As RoundUpValue``

#### arnelgp

##### ..forever waiting... waiting for jellybean!
Hatmak will probably favor this forum. Why?

Solved Rounding
Replies
8
Views
713
Replies
8
Views
124
Replies
5
Views
139
Replies
7
Views
433
Replies
13
Views
260