+ Reply to Thread
Results 1 to 4 of 4

Display chosen number if cell text begins with specific letter

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

    Display chosen number if cell text begins with specific letter

    Hi,

    I'm trying to write an IF formula that will return a number if the word in the adjacent cell begins with a specific letter.

    Here's what I want to show:

    City 01
    Express 02
    Overnight 03

    So "C" would return 01, "E" would return 02 and "O" would return 03.

    Not quite sure where to start. Any help would be much appreciated.
    Last edited by BPSJACK; 04-03-2014 at 07:58 AM.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Display chosen number if cell text begins with specific letter

    Several ways of doing this. In the attached example I've used a combination of LEFT and VLOOKUP with a small lookup table (the yellow cells) to look at the first letter of the text in column A and return the relevant number in column B.

    You could use LOOKUP for another method, but I find this VLOOKUP method is easy to maintain if that list gets longer.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Display chosen number if cell text begins with specific letter

    Maybe use vlookup with a wildcard, so if your data above is in A1:B3 and "C" is in C1 then
    =VLOOKUP(C1&"*",A1:B3,2,0)

  4. #4
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Display chosen number if cell text begins with specific letter

    Please Login or Register  to view this content.
    Click on the star if you think I helped you

+ 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. If Cell Begins with a Letter, Output...
    By Ocean Zhang in forum Excel General
    Replies: 8
    Last Post: 09-28-2022, 08:50 AM
  2. [SOLVED] Help Required To Ensure A Cell Begins With A Specific Letter
    By Flunter in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2013, 04:19 PM
  3. [SOLVED] IF number/text in a cell begins with specific letter, then return desired word
    By BPSJACK in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2013, 06:02 AM
  4. [SOLVED] Insert text to cell based on whether the value begins with a letter or number.
    By BPSJACK in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-23-2012, 09:57 AM
  5. Replies: 22
    Last Post: 06-02-2012, 11:45 AM

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