Create function to round all numbers in a column

  • Thread starter Thread starter Marianne
  • Start date Start date
M

Marianne

Is there a way to create a function that will round all
numbers in a column to the nearest integer, rather than
creating a separate formula for each individual cell?
What am I missing?

Thank you!!
 
You could write the formula for the first cell in the
column and then fill down...

=round(C1,0) to round to the nearest Integer
=Int(C1) just to get the integer part regardelss of the
fraction.
=roundup(C1,0) To round UP always
=rounddown(C1,0) To round DOWN

Cheers
Juan
 
No, you would need a macro unless you want to use help column(s)

Sub RoundMe()
Application.ScreenUpdating = False
For Each cel In Selection
cel.Value = Application.WorksheetFunction.Round(cel.Value, 0)
Next cel
Application.ScreenUpdating = True
End Sub

as an example will round the values you select to the nearest integer

--

Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Back
Top