PDA

View Full Version : Solved: If statement - Cell starts with Number



Alphacsulb
08-14-2008, 01:53 PM
I'm having a hard time figuring out what the formula is for this.

Example:
A1: 215 W Pacific
A2: PO BOX 2545

Formula goes in cell B1:
IF A1 starts with a number then =LEFT(A1,FIND(" ",A1)-1) IF not then =A1

End Result I would want:
B1: 215
B2: PO BOX 2545

:whistle: Any leads?

I posted on: But got no leads.
http://www.mrexcel.com/forum/showthread.php?p=1656308#post1656308

stanleydgrom
08-14-2008, 02:33 PM
Alphacsulb,

Try in cell B1 (copied down):
=IF(ISNUMBER(VALUE(LEFT(A1,1))),LEFT(A1,FIND(" ",A1,1)-1),A1)


Have a great day,
Stan

Alphacsulb
08-14-2008, 02:53 PM
Alphacsulb,

Try in cell B1 (copied down):
=IF(ISNUMBER(VALUE(LEFT(A1,1))),LEFT(A1,FIND(" ",A1,1)-1),A1)


Have a great day,
Stan

That worked out great. Here is the other answer to the question I had posted on the other forum for posterity.

=IF(ISNUMBER(VALUE(LEFT(A1,1))),RIGHT(A1,LEN(A1)-FIND(" ",A1)*1)," ")