View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default 2.3345 I want to find out what the last 2 digits are, i.e. 45

On Tue, 15 Nov 2005 04:21:03 -0800, Marcus
wrote:

I am lookig for a way to figure out what the last 2 digits are in a numeric
string. In my example above, I would like to know w hat the last 2 sigits
are in 2.3345 and have it return a value of 45 in a new cell.

Thank you.

Mark


We require more information.

It seems like a simple question, but it may not be.

If you want the last two significant digits, independent of formatting, that's
relatively simple.

If you want the last two digits displayed, and you have some kind of fixed
formatting, that, too, is doable.

If you want to return the last two digits displayed, and the format is General,
the last two numbers will depend on the width of the cell. That is difficult.


The following examples assume your original number is in A1.

To get the last two significant digits, independent of formatting, you'll need
two columns.

B1: =SUBSTITUTE(TEXT(A1,"0."&REPT("0",15)),".","")

C1: **Array** formula
=MID(B1,LEN(B1)-MATCH(TRUE,LEFT(RIGHT(
B1,ROW(INDIRECT("1:"&LEN(B1)))),1)"0",0),2)

To enter an **Array** formula, after pasting/typing the formula into the
formula bar, hold down <ctrl<shift while hitting <enter. Excel will place
braces {...} around the formula.

This formula will give an ERROR if there are not two significant digits.

Other solutions forthcoming depending on your specifications.




--ron