how to display rounded number in a cell w/formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a formula in place, my result appears as 1.746724891, i'd like an auto
rounded # to appear w/out interfereing w/the formula already in place.
How do I do this?
 
Select the cell(s) to be impacted

From the Excel main menu:
<format><cells><Number tab>
Experiment with the Category and Type options.

If none of them are appropriate....
Post back with your requirements and we'll see if a Custom Number Format
will work for you.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
If it is just for appearance then format the cell as number with decimals to
your liking
 
You can format the cell as NUMBER n decimal places. However, this only
affects the *displayed* value. If you format to 2 decimal places the cell
will display 1.75 but the true underlying value of the cell is still
1.746724891.

You could wrap your current formula inside the ROUND function. The value
returned in this case is the true underlying value.

=ROUND(your_formula,2)

Returns 1.75 as the true underlying value.

Biff
 
If you don't want to format to 2 decimal places for appearance and need the
value actually rounded, you can use this macro to add the ROUND function to all
cells in place.

Sub RoundAdd()
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 & ",2)"
End If
End If
Next
End Sub


Gord
 
Back
Top