Home > Enterprise >  How to find the position of the last non-zero value of a decimal in a cell in Excel
How to find the position of the last non-zero value of a decimal in a cell in Excel

Time:04-08

I have the following 4 rows and I wish to find the decimal length (aka scale) of that decimal value. Do note that I'm importing all of the decimal data in Excel whose cell is formatted in a "Text" format (hence the trailing zeros even after the decimal values). And I do not want to convert it into decimal. I just need to find the scale of that decimal number.

Decimal Number Scale (Formula?)
106.520000 2
0.080100 4
15.000010 5
265.000000 0

Been struggling for a very long time now. I'd appreciate any lead on this.

CodePudding user response:

This is what I have tried,

FORMULA_SOLUTION

• Formula used in cell B2

=LEN(MID(NUMBERVALUE(A2),FIND(".",A2) 1,255))

CodePudding user response:

You could try:

enter image description here

Formula in B2:

=MAX(LEN(-A2)-LEN(INT(A2))-2,0)

Note: I use a decimal comma but it shouldnt matter for you.

  • Related