Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Calculations and significant digits

Hi Niklas

Excel has no function for this (and I've always wondered why), but try this:

=ROUND(A1,2-INT(LOG(ABS(A1))))

The 2 is "significant digits minus 1", change to fit your needs or change it
to a cell variable.

HTH. best wishes Harald

"Niklas" skrev i melding
...
Hi
Are their any worksheet function I can use to convert a value to the
desiered significant values? At the moment I have created a UDF doing

this,
but I prefer to use worksheet function.

Some examples
Value Significant digits New value
-0.001 3 -0.001
1.99999999 3 2.00
2.00000001 3 2.00
0.012345 3 0.0123
0.00010 3 0.00010

Regards
/Niklas



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Calculations and significant digits

Thank you. We can hope that Excel will have one in the future. I will use you
soloution and hopefully the users do not complain when they lose presicion
when 0.0010 will be converted to 0.001
Regards
/Niklas

"Harald Staff" wrote:

Hi Niklas

Excel has no function for this (and I've always wondered why), but try this:

=ROUND(A1,2-INT(LOG(ABS(A1))))

The 2 is "significant digits minus 1", change to fit your needs or change it
to a cell variable.

HTH. best wishes Harald

"Niklas" skrev i melding
...
Hi
Are their any worksheet function I can use to convert a value to the
desiered significant values? At the moment I have created a UDF doing

this,
but I prefer to use worksheet function.

Some examples
Value Significant digits New value
-0.001 3 -0.001
1.99999999 3 2.00
2.00000001 3 2.00
0.012345 3 0.0123
0.00010 3 0.00010

Regards
/Niklas




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Calculations and significant digits

Just tell them that they don't. To you and me, 0.01 and 0.0100 mean
different things, to a computer it's the very same number.

Just by curiocity, what do you use this for ?

Best wishes Harald


"Niklas" skrev i melding
...
Thank you. We can hope that Excel will have one in the future. I will use

you
soloution and hopefully the users do not complain when they lose presicion
when 0.0010 will be converted to 0.001




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculations and significant digits

I teach High School physics, and I want to put together a series of self
quizzes for my students. At this level, there are only a handful of
different ways you can ask questions, so all that really changes is the
numbers. Many of my students just need the practice with their calculators
more than anything else.

Ideally, I'd like the quiz to generate the answers (easy) to the correct
number of significant digits (a little more complicated) without having to
cheat (that is, always having the same number of sig digs).


"Harald Staff" wrote:

Just tell them that they don't. To you and me, 0.01 and 0.0100 mean
different things, to a computer it's the very same number.

Just by curiocity, what do you use this for ?

Best wishes Harald


"Niklas" skrev i melding
...
Thank you. We can hope that Excel will have one in the future. I will use

you
soloution and hopefully the users do not complain when they lose presicion
when 0.0010 will be converted to 0.001





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Calculations and significant digits

I know this post has been here awhile, but I just came across it and thought
I should comment.

This is a great function for finding the significant figures. However, this
formula needs some modification and a snippet of code if it is to be used in
VBA. This is due to the fact that in VBA log() and ln() are one in the same
and considered to be the natural log. Here's I used this function in my code:

....
For Each c In Range_B
c.Value = Round(c.Value, 5 - Int(Log10(c.Value)))
Next

And add the following:

Static Function Log10(X)
Log10 = Log(X) / Log(10#)
End Function


Note: In this example I was using 5 sig figs.

Hope this is helpful
Mike

"Harald Staff" wrote:

Hi Niklas

Excel has no function for this (and I've always wondered why), but try this:

=ROUND(A1,2-INT(LOG(ABS(A1))))

The 2 is "significant digits minus 1", change to fit your needs or change it
to a cell variable.

HTH. best wishes Harald

"Niklas" skrev i melding
...
Hi
Are their any worksheet function I can use to convert a value to the
desiered significant values? At the moment I have created a UDF doing

this,
but I prefer to use worksheet function.

Some examples
Value Significant digits New value
-0.001 3 -0.001
1.99999999 3 2.00
2.00000001 3 2.00
0.012345 3 0.0123
0.00010 3 0.00010

Regards
/Niklas






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
significant digits Gordon[_2_] Excel Worksheet Functions 20 October 1st 08 07:14 PM
Excel adds significant digits, resulting in errors in calculations Scoutwert Excel Worksheet Functions 6 September 19th 06 03:27 PM
Significant digits Marcus Excel Worksheet Functions 5 November 16th 05 03:39 PM
Calculations and significant digits macropod[_6_] Excel Programming 0 September 14th 04 09:54 AM
Calculations and significant digits Nikos Yannacopoulos[_5_] Excel Programming 0 September 14th 04 09:44 AM


All times are GMT +1. The time now is 03:44 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"