Closed Thread
Results 1 to 9 of 9

If Cell Begins with a Letter, Output...

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-29-2009
    Location
    Chattanooga, TN
    MS-Off Ver
    2021
    Posts
    205

    If Cell Begins with a Letter, Output...

    I need a conditional formula where if the contents in cell A1 begins with "LA" then return a value. It must specifically begin with these 2 letters and not have these 2 letters somewhere else in the string.

    example:

    lair = true
    flair = false
    lake = true
    blake = false

    Thanks!
    Last edited by Ocean Zhang; 06-03-2011 at 12:53 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If Cell Begins with a Letter, Output...

    Try:

    =LEFT(A1,2)="LA"
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: If Cell Begins with a Letter, Output...

    Hi Ocean Zhang,

    In A2 put your text string and then do this formula on it.
    =AND(LEFT(A2,2)="la",ISERROR(FIND("la",A2,2)))
    Attached Files Attached Files
    Last edited by MarvinP; 06-03-2011 at 12:39 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: If Cell Begins with a Letter, Output...

    What happens in "lalaland"?......

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: If Cell Begins with a Letter, Output...

    My formula give back false in "lala land" as I think the OP wanted.

  6. #6
    Forum Contributor
    Join Date
    05-29-2009
    Location
    Chattanooga, TN
    MS-Off Ver
    2021
    Posts
    205

    Re: If Cell Begins with a Letter, Output...

    Thanks guys for showing me the "left" function! This worked:

    =if(left(a1,2)="la","good","")

    Thanks!

  7. #7
    Registered User
    Join Date
    09-28-2022
    Location
    London
    MS-Off Ver
    10
    Posts
    3

    Re: If Cell Begins with a Letter, Output...

    Quote Originally Posted by Ocean Zhang View Post
    Thanks guys for showing me the "left" function! This worked:

    =if(left(a1,2)="la","good","")

    Thanks!
    Thank you this was perfect for me and what I'm looking to do.....However I have codes that start with 1 of 3 letters in a column, if they start with e I want say "eggs" returned, if they start with I I want say "India" returned and if they start with V I want say "Voice" returned, is there a way I can extend this formula to have all 3 options covered?
    so
    =if(left(a1,1)="E","eggs","") then how do I extend this to cover the other two possibilities?
    Thanks so much in advance, glad I came across this thread!

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: If Cell Begins with a Letter, Output...

    @ MarvinP
    I did notice this, just thought I'd prompt the OP

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,425

    Re: If Cell Begins with a Letter, Output...

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed 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