+ Reply to Thread
Results 1 to 5 of 5

Lookup based on a partial text string

  1. #1
    Registered User
    Join Date
    02-23-2021
    Location
    Edmonton, Canada
    MS-Off Ver
    Excel 2016
    Posts
    30

    Lookup based on a partial text string

    I need some help with a translation from one column to another.

    I have 17 Reference that tells what area of the country that buy something. (see column A in the Excel sheet)
    Our PO's starts with TJB, TJH, TJC and so on and T! or TX (see column C in the Excel sheet)

    Somehow I would like to translate so the first 2 digits in the Column C will be translated to the correct Reference in column A.

    TJB XXXXX, TJH XXXX and ALL Of the numbers in column C that starts with TJ should be coded to TODX in column A
    The same would go to
    All the numbers in column C that starts with T! should be coded to TDE in column A
    All the numbers in column C that starts with TX should be coded to XXST in column A

    So it is the 2 first digits in column C that needs to be translated somehow. but I do not know how to do it.

    I would like to have the translation show up in column B.

    I am grateful for all help I can get.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,965

    re: Lookup based on a partial text string

    Try this:

    =LOOKUP(LEFT(C2,2),{"T!","TJ","TX"},{"TDE","TODX","XXST"})

    BtW, your thread title is very weak. A GOOD thread title is the sort of thing you would use as a search term on Google*. Your chosen title would produce a squillion useless hits. In future, please take a bit more time to think of a descriptive title that would be "Google-friendly". Many people search the forum answers looking for help and your very general title wouldn't help them at all.

    Since you are a FAIRLY new user of this site, on this occasion, I have changed it for you.

    However, if you continue to use weak titles, you can expect to have your thread BLOCKED until you change it yourself. If that happens, to edit the thread title, open the original post, click "Edit Post" (bottom right) to access the area where you can edit your title.

    *Other search engines are available!!!

    Regards,

    Glenn.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Lookup based on a partial text string

    Just make yourself a lookup table for all unique two character codes and the required reference. Similar to what I've done in the attached.

    WBD
    Attached Files Attached Files
    Office 365 on Windows 11, looking for rep!

  4. #4
    Registered User
    Join Date
    02-23-2021
    Location
    Edmonton, Canada
    MS-Off Ver
    Excel 2016
    Posts
    30

    Re: Lookup based on a partial text string

    Glenn

    Thank you so much for the help.

    I did not know what to do and what kind of help I needed, I did not know if it was a lookup or a if, so that is why my title was a bit weak, sorry for that.
    I will try to do better next time.

    I also think I posted it in the wrong forum as it should have been in the formula, but I did not know how to change it.

    Once again thanks for your help.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,965

    Re: Lookup based on a partial text string

    Meh! It's often a close call for the sub-forum thing.

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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] How to lookup a partial text string
    By joh_ver in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-09-2016, 04:47 PM
  2. Partial lookup from text string, return value from lookup list
    By TotallyLost in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-13-2016, 12:14 PM
  3. Partial Text String Lookup from a List
    By lookingforhelp1 in forum Excel General
    Replies: 5
    Last Post: 01-14-2016, 09:15 AM
  4. Complex matching with indirect lookup based on partial string match
    By jdcb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-17-2012, 08:19 AM
  5. Return Value Based On Partial Text String
    By JonnyBoy333 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-12-2011, 09:29 AM
  6. Getting info from another workbook based on partial string lookup
    By 96HawkCnvt in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-10-2010, 03:33 PM

Tags for this Thread

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