How to round cells to two significant figures

G

Guest

I've been doing masses of calculations on excel and now i want to round my numbers to two significant figures quickly without having to do them one at a tim
 
C

CLR

Hi Kristy...........

Direct from the Help file..........

ROUND

Rounds a number to a specified number of digits.

Syntax

ROUND(number,num_digits)

Number is the number you want to round.

Num_digits specifies the number of digits to which you want to round
number.

If num_digits is greater than 0 (zero), then number is rounded to the
specified number of decimal places.


If num_digits is 0, then number is rounded to the nearest integer.


If num_digits is less than 0, then number is rounded to the left of the
decimal point.

Examples

ROUND(2.15, 1) equals 2.2

ROUND(2.149, 1) equals 2.1

ROUND(-1.475, 2) equals -1.48

ROUND(21.5, -1) equals 20

You can also replace the number with a cell reference, like =ROUND(A1,2)

Others of interest might be ROUNDUP, ROUNDDOWN, MROUND.........

Vaya con Dios,
Chuck, CABGx3



Kirsty said:
I've been doing masses of calculations on excel and now i want to round my
numbers to two significant figures quickly without having to do them one at
a time
 
D

DME

Kristy-

I believe you were looking for something like this.

Try this Macro.



Sub RoundAdd0()

Dim myStr As String

Dim Cel As Range

For Each Cel In Selection

If Cel.HasFormula = True Then

If Not Cel.Formula Like "=ROUND(*" Then

myStr = Right(Cel.Formula, Len(Cel.Formula) - 1)

Cel.Value = "=ROUND(" & myStr & "," & "0" & ")"

End If

End If

Next

End Sub



Create a new Button and assign this macro to it. This is set up to round to
the nearest $1. If you want to round to the nearest 10 change the "0" to "1"
or to the nearest 100 change to "2".

then all you do is highlight all the cells you want to round and run this
macro. I have 3 buttons set up for rounding to the nearest 1, 10 and 100 and
use them all the time. Saves a ton of time.

Hope this helps.

Craig

Kirsty said:
I've been doing masses of calculations on excel and now i want to round my
numbers to two significant figures quickly without having to do them one at
a time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top