Consulting

Results 1 to 3 of 3

Thread: Solved: If statement - Cell starts with Number

  1. #1

    Solved: If statement - Cell starts with Number

    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

    Any leads?

    I posted on: But got no leads.
    http://www.mrexcel.com/forum/showthr...08#post1656308

  2. #2
    VBAX Tutor
    Joined
    Nov 2006
    Location
    North East Pennsylvania, USA
    Posts
    203
    Location
    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

  3. #3
    Quote Originally Posted by stanleydgrom
    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)," ")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •