+ Reply to Thread
Results 1 to 6 of 6

Compare two columns - If the text of one column is present in the other column

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    3

    Compare two columns - If the text of one column is present in the other column

    Hi,

    I need a formula to compare two columns from different tables:
    Table 1 has a column (C) with a description and table 2 has a column with a keyword (A) and another column with a type (B).
    I need to compare if the keyword from table 2 is present in the description of table 1 and if so return the keyword and the type in another column.

    Example:

    Table 1

    Column C (Description)
    Apple Pie
    Orange Juice
    Sony TV
    Sony Laptop

    Table 2

    Column A (Keywords) -------- Column B (Type)
    Apple ------------------------- Food
    Orange ------------------------Food
    Sony --------------------------Eletronics

    Result on table 1

    Column C (Description) -----Column D (Keyword) ----Column E (Type)
    Apple Pie -------------------- Apple ---------------------- Food
    Orange Juice-------------------Orange ------------------- Food
    Sony TV ---------------------- Sony --------------------- Eletronics
    Sony Laptop ------------------Sony --------------------- Eletronics

    Tks
    Last edited by paulocintra; 08-14-2013 at 10:40 PM.

  2. #2
    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,047

    Re: Compare two columns - If the text of one column is present in the other column

    Hi and welcome to the forum

    Your tables and columns are confusing, please upload a sample workbook.

    You probably need to use something like...........=iferror(vlookup(A1&"*",

    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

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

    Re: Compare two columns - If the text of one column is present in the other column

    Thank you FDibbins.

    Follow the excel file attached...
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Compare two columns - If the text of one column is present in the other column

    Hi,

    In D2 and copy down, enter this array formula (confirm with CTRL+SHIFT+ENTER, not just ENTER):

    =INDEX(Sheet2!$A$2:$A$4,MATCH(TRUE,ISNUMBER(SEARCH(Sheet2!$A$2:$A$4,Sheet1!C2)),0))

    In E2 and copy down (normal formula this time):

    =VLOOKUP(F2,Sheet2!$A$2:$B$4,2,0)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    08-14-2013
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Compare two columns - If the text of one column is present in the other column

    Thank you XOR LX! It works perfectly...

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Compare two columns - If the text of one column is present in the other column

    You're welcome.

+ 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] Create formula to sum column total if specific text is present in second column
    By Banir in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2013, 07:48 AM
  2. [SOLVED] Compare 4 column values then insert a 5th columns value to a blank column/cell value
    By JasonKMcCoy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2012, 06:01 PM
  3. compare 2 columns and create new column with missing values in second column
    By Jroelan2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2012, 12:33 AM
  4. Compare 2 columns near equiv (one has text included) and output to new column
    By CNE5x in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 01:24 PM
  5. Replies: 1
    Last Post: 08-02-2006, 09:08 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