ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatic formatting of Significant Figures .... (https://www.excelbanter.com/excel-discussion-misc-queries/46604-automatic-formatting-significant-figures.html)

CFD

Automatic formatting of Significant Figures ....
 

Hi all,

I have a table of numbers, ranging from about 0.552 to about 821. All
numbers have exactly 3 significant figures.

Is there any way to automatically format ALL the numbers in this table
to show exactly 3 significant figures only, without having to resort to
exponent notation?

Thanks in advance!


--
CFD


------------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=469743


Ron Rosenfeld

On Wed, 21 Sep 2005 19:56:49 -0500, CFD
wrote:


Hi all,

I have a table of numbers, ranging from about 0.552 to about 821. All
numbers have exactly 3 significant figures.

Is there any way to automatically format ALL the numbers in this table
to show exactly 3 significant figures only, without having to resort to
exponent notation?

Thanks in advance!


No you cannot do that with formatting.

You would have to "round" the number to three significant digits; then format
as General.

Worksheet formula:

=ROUND(A12,TRUNC(-LOG(ABS(A12)))+3-(ABS(A12)1))

or VBA UDF:
=======================
Function RoundSigDigits(N As Double, SigDigits As Integer) As Double
RoundSigDigits = Application.WorksheetFunction.Round _
(N, Fix(-Log(Abs(N)) / Log(10)) + SigDigits + (Abs(N) 1))
End Function
======================


--ron

CFD


Bugger, thought as much .... :mad: You would think such a
straight-forward and immensely useful functionality would be included!

Thanks forn the response though!


--
CFD


------------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=469743


Ron Rosenfeld

On Wed, 21 Sep 2005 21:10:03 -0500, CFD
wrote:


Bugger, thought as much .... :mad: You would think such a
straight-forward and immensely useful functionality would be included!

Thanks forn the response though!


I think Excel's genesis was as a business tool. As such, some of what
mathematicians might feel is useful functionality is just not there.

I don't know if there is another tool that has the functionality for which you
are looking.


--ron

CFD


LOL hardly a mathamatician, who wouldn't care about sig figs anyway! No,
I'm an engineer.

And buisiness people would probably be interested as well, if you have
a table of prices and percentages, you might want all to 4 sig figs eg
$1234 and 75.33% but you cant easily format like that.

Admittedly, it is far more important for engineering applications.


--
CFD


------------------------------------------------------------------------
CFD's Profile: http://www.excelforum.com/member.php...o&userid=27306
View this thread: http://www.excelforum.com/showthread...hreadid=469743



All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com