significant figures problem

BAlGaInTl

Well-known Member
Joined
May 7, 2003
Messages
1,082
Hello all...

I'm using a formula that I found elsewhere on the board to rount a number based on significant figures. This is a sample of what I'm using.

ROUND(G32,B11-1-INT(LOG10(ABS(G32))))

Where G32 is the number you want to round, and B11 is the number of sig. figs. desired.

Here is the problem that I have found. It seems that Excel insists on dropping the last number if it is a zero. So, in effect, what you get is not correct if the last significant figure is a zero.

Example. Lets say that I want 2 significant figures.

0.00123 will correctly display as 0.0012

However,

0.00101 will display as 0.001, which is only 1 significant figure, and not 2.

This only happens when the last number is a zero.

Help?
 
sdible said:
....................................

=IF(B8-1-INT(LOG10(ABS(A8)))<=0,ROUND(A8,B8-1-INT(LOG10(ABS(A8)))),IF(ISERROR(TEXT(A8, "#,##0." & REPT(0,B8-1-INT(LOG10(ABS(A8)))))),FIXED(A8,B8-INT(LOG10(ABS(A8)))-1),TEXT(A8, "#,##0." & REPT(0,B8-1-INT(LOG10(ABS(A8)))))))

....................................

:pray:

Sdible,

A more simple significant figures solution, the formula enter in D3 :

=FIXED($A3,$B3-INT(LOG10(ABS($A3)))-1)

The formula haven't be fully tested, but achieve the same results in the below datas.

This is shown below:
Book1
ABCDE
1ModifiedSimplified
2NumSigFigsformulaformula
30.00012310.00010.0001
40.00012320.000120.00012
50.00012330.0001230.000123
60.00012340.00012300.0001230
70.0012310.0010.001
80.0012320.00120.0012
90.0012330.001230.00123
100.0012340.0012300.001230
110.123410.10.1
120.123420.120.12
130.123430.1230.123
140.123440.12340.1234
1512.34511010
1612.34521212
1712.345312.312.3
1812.345412.3512.35
19128.5671100100
20128.5672130130
21128.5673129129
22128.5674128.6128.6
231234.5110001,000
241234.5212001,200
251234.5312301,230
261234.5412351,235
27
Sheet1
 
Upvote 0
Thank you very much bosco-yip

I am currently working on converting 50,000 imperial volume measures to metric units, and rounding the result by 4 significant figures.

Your shortened formula: =FIXED($A3,$B3-INT(LOG10(ABS($A3)))-1) works on my test numters.

However, I noticed that when the values, which are produced from the formual are summed in column - i.e. using Excel's SUM function the result is 0.

Any idea why this would happen? And how to solve it?

My real concern, however, is I need to multiply the result of your formula in order to produce a rate (i.e. thousands of rounded metric conversions multiplied by a number to produce rate).

Thankfully, mulitplication seems to work

Any comments which you might have would be greatly appreciated.

Thank you
 
Upvote 0
Book1
ABCD
1imperialmetricratewith
2volumevolumemultipliednumber
3ft3m35.00
4123,545.003,49817,490.00
510,000.00283.11,415.50
6320.009.06045.30
7Total:3,790.16
8
Sheet1


Mike Collett,

Q.1) Regarding converting imperial volume measures to metric units, and rounding the result by 4 significant figures.

Enter formula in Cell B4 :

=FIXED($A4/35.31984,4-INT(LOG10(ABS($A4/35.31984)))-1)

The conversion is based on :
1) Formula : =FIXED(Num,SigFig-INT(LOG10(ABS(Num)))-1)
2) 1 m3 = 35.31984 ft3
3) Significant figures (SigFig) = 4


Q.2) To multiply the result of formula in order to produce a rate

In C3 house the multiplied number

Enter formula in Cell C4 :

=B4*$C$3

Q.3) SUM function the significant figuresc results

In B7 enter array formula ( Shift+Ctrl+Enter) :

=SUM(VALUE(B4:B6))


Hope can helps

Regards
Bosco
 
Upvote 0
Bosco_yip

Your solution is much shorter and effective for sure.

For anyone interested, I have made a couple of modifications for people that I work with.

The first is the ability to change from SigFigs to Decimal precision. I achieved this by having the user use a negative sig fig instead of a positive one. So, by entering -2, 12.345 would be rounded to 12.35.

Code:
=IF(B25>=0,FIXED(A25,B25-INT(LOG10(ABS(A25)))-1),ROUND(A25,ABS(B25)))

Where B25 is the number of sigfigs and A25 is the number to be rounded.

Of course, if the user wants to force trailing zeros, the ROUND statement can be changed to FIXED.

The second is to use SigFigs, but with a limiter to the maximum number of decimal places that can be used. In this case if a user wants 3 sigfigs and no more than 4 decimal places they could use the formula

Code:
=IF(C37<B37-INT(LOG10(ABS(A37)))-1,ROUND(A37,C37),FIXED(A37,B37-INT(LOG10(ABS(A37)))-1))

Where C37 is the "maximum decimal precision" desired, B37 is the SigFigs desired, and A37 is the number to be rounded. Using this formula for the number 0.001268 to 3 sig figs with a maximum decimal precision of 4 would result in 0.0013 returned. Again, if trailing zeros are desired when MDP is used, the ROUND statement can be changed to FIXED.

Just in case anyone can use these. I may rewrite my function to be used in the following manner

Code:
=SigFig(Number,SigFigs,[MDP])

where the MDP would be optional.
 
Upvote 0

Forum statistics

Threads
1,226,834
Messages
6,193,216
Members
453,780
Latest member
enghoss77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top