Hi
To capture leftmost numeric character as number:
=IF(LEN(A1)=0,"",IF(ISNUMBER(--LEFT(A1,1)),--LEFT(A1,1),""))
To capture 2 leftmost numeric characters as number:
=IF(LEN(A1)=0,"",IF(ISNUMBER(--LEFT(A1,2)),--LEFT(A1,2),""))
To capture 2nd leftmost numeric character as number:
=IF(LEN(A1)=0,"",IF(ISNUMBER(--MID(A1,2,1)),--LEFT(A1,2,1),""))
(Formulas work in cases there exist non-numeric characters in A1 too)
Arvi Laanemets
"Kelly O." wrote in message
...
I am trying to find a formula that will allow me to extract only the very
first number in a cell. For example, if I have the number 123456 in cell
A2,
I would like a formula in cell A1 that will give me only the value 1; if I
have the number 234567 in cell B2, I only want the value 2 in cell B2, and
so
on. Further, is it possible to capture more than the first number if I
need
more than that?
Thanks, Kelly
|