Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Significant Digits

Status
Not open for further replies.

WillisV

Structural
Joined
Apr 24, 2005
Messages
1,352
Location
US
Is there a way to have excel only display a certain number of significant digits?
 
You need to modify sdz formula slighly to make it work for negative numbers:
=round(Var,SigFig-int(log(abs(Var)))-1)

adding the ABS gives you the absoultue value of your number, making the formula work for negative numbers.
 
If you are willing to use extra columns and use "Precision as displayed" option, it could be done very simply as follows:

First, check "Precision as diplayed" in Tools/Options/Calculations

Col A: Using "General" number format, input orginal value
Col B: Set column number format to scientific, with the desired precision, and have the number from column A
Col C: Set column number format to "General" and set it equal to the value in column B

For some examples assuming "decimal places" for scientific format set at 3:
Col A: 156.7811
Col B: 1.568 E 2
Col C: 156.8

Col A: -0.00125668
Col B: - 1.257 E -3
Col C: -0.001257

Of course, it may be cleaner if you hide column B (and possibly column A as well) when you are done...

-- MechEng2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top