+ Reply to Thread
Results 1 to 5 of 5

Lookup value in workseet 2, if exists specific cell, insert different text in Worksheet 1

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    Easter Island
    MS-Off Ver
    Excel 2010
    Posts
    2

    Lookup value in workseet 2, if exists specific cell, insert different text in Worksheet 1

    I am attempting to enter a formula that, while working in Worksheet 1, will look at a data set in worksheet 2 for a specific set of text within a specific column, and if existing, will insert a different set of text into a specfic cell in worksheet 1.

    Example:

    Worksheet 1

    C2 - I need to display "RED BLUE"

    If

    Worksheet 2

    A2 = RB

    Thanks in advance for any help you can provide.

    benicio

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: Lookup value in workseet 2, if exists specific cell, insert different text in Workshee

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    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
    53,048

    Re: Lookup value in workseet 2, if exists specific cell, insert different text in Workshee

    Hi and welcome to the forum

    You need to use vlookup() to search for what you want, but then you need to wrap that in
    =if(iserror(your_vlookup)),"",what_you_want_displayed)
    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

  4. #4
    Registered User
    Join Date
    04-19-2013
    Location
    Easter Island
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Lookup value in workseet 2, if exists specific cell, insert different text in Workshee

    Example.xlsx

    Example attached.


    --FDibbins, can you look at the example workbook? I am unsure as to how to get the vlookup to function before even getting to the =if(iserror portion.

    Thanks for helping nonetheless.


    benicio

  5. #5
    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
    53,048

    Re: Lookup value in workseet 2, if exists specific cell, insert different text in Workshee

    OK heres what I did. (there are a number of ways to solve this, but this is probably 1 of the easier ways).

    1st, create a table where you have the abbreviations in 1 column and the colors in another - I used S2:T5 and had this...

    RB...Red Blue
    BG...Blue Green
    RY...Red Yellow
    YG...Yellow Red

    Then on sheet1 C2, copied down, use this...
    =IFERROR(VLOOKUP(Sheet2!A2,Sheet2!$S$2:$T$5,2,FALSE),"")

    The data you provided is probably dummy data, so hopefully you can apply this to the real data?

+ 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