+ Reply to Thread
Results 1 to 5 of 5

Return TRUE if 1st 2 characters in text are alpha values

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    SLC
    MS-Off Ver
    Excel 2007
    Posts
    7

    Return TRUE if 1st 2 characters in text are alpha values

    Using Excel 2007.

    In Column A, (formatted as text), I have various text values, some beginning with 2 alpha values followed by several numeric values (i.e. AB123456), others contain just pure numbers (012345). In column B, i would like to create an IF statement that will return a TRUE if the 1st 2 characters in the cell in A are alpha values.

    So, if my Column A looked like below, Column B would return:

    A B
    AB123456 TRUE
    0987654 FALSE
    ZY987654 TRUE
    123789 FALSE
    Last edited by BasinCruiser; 05-22-2013 at 09:31 AM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Return TRUE if 1st 2 characters in text are alpha values

    Try this:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Return TRUE if 1st 2 characters in text are alpha values

    =not(isnumber(--left(a1,2)))

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return TRUE if 1st 2 characters in text are alpha values

    Here's another possibility:

    =ISERR(-LEFT(A2,2))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    05-21-2013
    Location
    SLC
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Return TRUE if 1st 2 characters in text are alpha values

    Quote Originally Posted by ConneXionLost View Post
    Try this:

    Please Login or Register  to view this content.
    ConneXion, Thank you for your help. But, this does not work. I'm not sure why, but it always returns TRUE, if the1st 2 characters are alpha or numeric.

    Quote Originally Posted by Ghozi Alkatiri View Post
    =not(isnumber(--left(a1,2)))
    Ghozi, this worked perfectly. Thank you very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1