Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave
 
Posts: n/a
Default how do i format a cell in Excel to 3 significant numbers

I need to format cells so that they only show 3 significant figures.

1.235 = 1.23
10.25 = 10.3
103.25 = 103

etc
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default how do i format a cell in Excel to 3 significant numbers

This will round to 3 sig figs =ROUND(A1, 3 - 1 - INT(LOG10(ABS(A1))))
BUT there is no simple way of stopping Excel showing no-sig trailing zeros
That would need a VBA subroutine

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Dave" wrote in message
...
I need to format cells so that they only show 3 significant figures.

1.235 = 1.23
10.25 = 10.3
103.25 = 103

etc



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default how do i format a cell in Excel to 3 significant numbers

Addendum: on the website
http://www.vertex42.com/ExcelTips/si...t-figures.html

I found this User defined function
Function ROUNDSF(num As Variant, sigs As Variant) As String
Dim exponent As Integer
Dim decplace As Integer
Dim fmt_left As String
Dim fmt_right As String
Dim numround As Double
If IsNumeric(num) And IsNumeric(sigs) Then
If sigs < 1 Then
' Return the " #NUM " error
ROUNDSF = CVErr(xlErrNum)
Else
If num = 0 Then
exponent = 0
Else
'Round is needed to fix a ?truncation?
'problem when num = 10, 100, 1000, etc.
exponent = Round(Int(Log(Abs(num)) / Log(10)), 1)
End If
decplace = (sigs - (1 + exponent))
numround = WorksheetFunction.text(num, "." & _
String(sigs, "0") & "E+000")
If decplace 0 Then
fmt_right = String(decplace, "0")
fmt_left = "0."
Else
fmt_right = ""
fmt_left = "0"
End If
ROUNDSF = WorksheetFunction.text(numround, _
fmt_left & fmt_right)
End If
Else
' Return the " #N/A " error
ROUNDSF = CVErr(xlErrNA)
End If
End Function

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Dave" wrote in message
...
I need to format cells so that they only show 3 significant figures.

1.235 = 1.23
10.25 = 10.3
103.25 = 103

etc



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sloth
 
Posts: n/a
Default how do i format a cell in Excel to 3 significant numbers

I posted this same question earlier. Excel has no automatic way to format to
significant digits, except scientific notation. I've seen no formula that
will show trailing zeros (ie 10.9999 will show as 11 and not 11.0), but you
can try these formulas and format the cells to general.

=LEFT(TEXT(A1,"0.00E+00"),4)*10^RIGHT(TEXT(A1,"0.0 0E+00"),3)
change "0.00E+00" to represent the number of signifiacant digits.

=ROUND(A1, A2 - 1 - INT(LOG10(ABS(A1))))
A1 is the number and A2 is the number of significant digits.

"Dave" wrote:

I need to format cells so that they only show 3 significant figures.

1.235 = 1.23
10.25 = 10.3
103.25 = 103

etc

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change format of page numbers to letters in Excel? DonnaGoof Excel Discussion (Misc queries) 2 November 15th 05 07:35 PM
Pasting Word table cell with paragraph markers into single Excel c Steve Excel Discussion (Misc queries) 1 June 16th 05 11:26 PM
Copying excel format from cell to cell Loopy Darren Excel Discussion (Misc queries) 2 April 12th 05 04:29 PM
My formulas can't 'see' numbers imported from Access in Excel, even when the format is the same. Chrism Excel Discussion (Misc queries) 4 April 12th 05 03:10 PM
format existing numbers in excel? Robin Excel Discussion (Misc queries) 6 March 3rd 05 11:11 PM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"