Round-up

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

CT Witter

MrExcel MVP
Joined
Jul 7, 2002
Messages
1,212
NullZero's function will fail for decimals that add up to less than 0.5

ie 4.1 will yield 4 not 5.

Try using this function from MS:

Place the following in a module.

Code:
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

An example of how to use in a query,
RoundNumber: Ceiling([Field1],1)

*Note: This function is accurate up to 14 decimal places ie 4.000000000000001 will yield 5, anything past will yield 4*

HTH,
CT
 

Watch MrExcel Video

Forum statistics

Threads
1,118,389
Messages
5,571,850
Members
412,421
Latest member
Rimo86
Top