+ Reply to Thread
Results 1 to 3 of 3

IF number/text in a cell begins with specific letter, then return desired word

  1. #1
    Forum Contributor
    Join Date
    01-06-2012
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    165

    IF number/text in a cell begins with specific letter, then return desired word

    Hi,

    I have a column of reference numbers which will either begin with the letter L, Q, or a numeric value. I want a cell in the adjacent column to return a word based on whether it begins with an L,Q or number. For example, if:

    Cell A1 = L123. Then B1 would show ABC
    Cell A2 = Q123. B2 would show XYZ
    Cell A3 = 2013. B3 would show 123.
    Cell A4 = L124. Then ABC.

    Etc Etc.

    I use the below formula to take into account two criteria for the formula (letter or numeric):
    =IF(G2="","",IF(ISNUMBER(LEFT(G2)+0),"123","ABC"))

    But am a bit clueless of how to take it a step further.

    Any help greatly appreciated.
    Last edited by BPSJACK; 01-28-2013 at 06:03 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,904

    Re: IF number/text in a cell begins with specific letter, then return desired word

    Try this:

    =IF(G2="","",IF(ISNUMBER(LEFT(G2)+0),"123",if(Left(G2,1)= "L","ABC", "XYZ")))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    01-06-2012
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    165

    Re: IF number/text in a cell begins with specific letter, then return desired word

    Works like a charm, thanks for your help!

+ 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