Rounding Up

TAD01

New Member
Joined
Jan 1, 2003
Messages
1
Sorry for the simple question but is there a Access function that rounds up to the next whole number? For example, 1.25 will round to 2.00.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
don't think so....

but you could use...

int(x)+1
or fix(x)+1

...the difference being how it reacts with negative numbers.
 
Upvote 0
Here are 2 functions courtesy of the NeatCode database by Microsoft...

Function Ceiling(N, ByVal Precision)
'
' Similar to Excel's Ceiling function
' Rounds up to the next higher level of precision.
' Precision cannot be 0.
'
Dim Temp As Double
Precision = Abs(Precision)
Temp = Int(N / Precision) * Precision
If Temp = N Then
Ceiling = N
Else
Ceiling = Temp + Precision * Sgn(Temp)
End If
End Function


Function ToBRoundInt(X As Variant) As Long
'
' Takes a variant, convertis it to a number and rounds it using Banker's Rounding.
' Null/Non-numeric values mapped to zero.
'
' i.e. n.5 rounds to the nearest even number.
' e.g. 1.5 -> 2, but 0.5 -> 0
'
' Fractions less than .5 always round down, and fractions greater always round up.
'
If Not IsNumeric(X) Then
ToBRoundInt = 0
Else
ToBRoundInt = X ' Banker's rounding
End If
End Function
 
Upvote 0

Forum statistics

Threads
1,221,497
Messages
6,160,151
Members
451,625
Latest member
sukhman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top