Forum Discussion
Keggsy
May 06, 2020Copper Contributor
reading number of decimal places
Hi all I’m trying to automate some number manipulation, where I am trying to apply a rounding tolerance, e.g. if a number is 1.25, then the tolerance is 1.254 and 1.245. I have used the formula =IF...
amit_bhola
May 06, 2020Iron Contributor
Keggsy , use CELL function to extract the format of cell, and then apply an IF to extract the decimals
=IF(CELL("format",A11)="G",IF(A11=INT(A11),0,LEN(MID(A11-INT(A11),FIND(".",A11,1),LEN(A11)-FIND(".",A11,1)))),VALUE(RIGHT(B11,LEN(B11)-1)))
but there is a big caution : -
Caution : For correct calculation as per latest changed cell values, you need to force recalculation of the Excel by pressing F9 function key or by going to FORMULAS>CALCULATION>CALCULATE NOW
see attached file