+ Reply to Thread
Results 1 to 8 of 8

Returning text Values based on text

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Returning text Values based on text

    Hi Guys

    Wondering if you could help me out. In column B i have various values for an object named with a letter followed by a number e.g. "B25". I want to basically use the letters in this column to return a value in another column, for which the letter stands for, like B stands for "BUP". So far i got it with
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    but column B is made up with other letters that i want included, like "S6" Which needs to be "SE" in the return column. Is there a way of expanding the formula i have already got?

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,604

    Re: Returning text Values based on text

    You have wrong approach... Use VLOOKUP function

  3. #3
    Registered User
    Join Date
    07-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Returning text Values based on text

    still can't seem to get it, any ideas?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Returning text Values based on text

    Hi and welcome to the forum

    I think it will be easier if you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    07-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Returning text Values based on text

    Ok no worries,

    So in the "PIT" spreadsheet, I basically want values in column G to be automatically generated from the letter in my "pit no" in column B. For example where there is a "B" in column B i want the same row
    in column G to equal "BUP", and so forth with "S" to be "SE", "HW" to be "HW" "M" to be "JP".

    Any help is appreciated.
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Returning text Values based on text

    1st, create a table with the letter and the code it represents, something like this (I added a new sheet and put this in A1:B4)...
    B.....BUP
    S.....SE
    HW...HW
    M.....JP

    Then use this ig G, copied down...
    =VLOOKUP(LEFT(B2,IF(ISNUMBER(MID(B2,2,1)*1),1,2)),Sheet1!$A$1:$B$4,2,0)

  7. #7
    Registered User
    Join Date
    07-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Returning text Values based on text

    that helps so much! thanks

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Returning text Values based on text

    Happy to help

    If you have extra codes tro add, add them to that table and then adjust the range in the formula accordingly

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively 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)

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