+ Reply to Thread
Results 1 to 6 of 6

I need to write a formula that looks for the first two characters in a string of text

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    Fairbury NE
    MS-Off Ver
    Excel 2007
    Posts
    70

    I need to write a formula that looks for the first two characters in a string of text

    Hi,
    I need to write a formula that looks for the first two characters in a string of text and returns a value in a column next to that text.

    I.e., if column D contains AA at the beginning of the text string, return a "yes" in column C, if no AA, return a "no" in column C. Is this possible?
    Last edited by maryren; 09-05-2013 at 10:47 AM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: I need to write a formula that looks for the first two characters in a string of text

    Try

    =IF(LEFT(D1,2)="AA","Yes","No")

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: I need to write a formula that looks for the first two characters in a string of text

    Perhaps

    =if(left(d1,2)="aa","yes","no")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    06-12-2013
    Location
    Fairbury NE
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: I need to write a formula that looks for the first two characters in a string of text

    Perfect! Thank you so much.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: I need to write a formula that looks for the first two characters in a string of text

    You're welcome.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: I need to write a formula that looks for the first two characters in a string of text

    You are welcome and thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Write string to text file and print?
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2005, 04:50 PM
  2. how to write data and string to a text file
    By NewGuy100 in forum Excel General
    Replies: 4
    Last Post: 10-10-2005, 09:19 PM
  3. Remove characters from a text string using a formula
    By duncrbrt in forum Excel General
    Replies: 1
    Last Post: 06-03-2005, 10:05 PM
  4. Replies: 1
    Last Post: 04-18-2005, 05:06 PM
  5. Replies: 1
    Last Post: 04-17-2005, 08:10 PM

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