2.3345 I want to find out what the last 2 digits are, i.e. 45

M

Marcus

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
 
D

Duke Carey

You can always use

=right(2.3345,2)*1

If your number is calculated in a cell, say A1, and you use

=right(A1,2)*1

you might get something besides 45, because the value Excel sees could be

2.33446666666

or something like that. So, you may want to ROUND() or TRUNC() the number
before using the RIGHT() function., like so

=RIGHT(ROUND(A1,4),2)*1
 
R

Ron Rosenfeld

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
 
M

Marcus

Thank you to all who posted. I am a newbie on this board and couldn't find
this original post (I didn't think that it made it), so I posted again today.
My apologies and thanks for your help.

Take care.

M
 
Top