+ Reply to Thread
Results 1 to 20 of 20

compare two columns and return match from third column

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    compare two columns and return match from third column

    Hi guys i need your help.
    I must match column A and column B to return the column C
    In colA there are all my countries
    In column B there are all my countries code and countries
    I want get the colC where all my colB match than colA

    So, I try to use functions but my excel said me error!
    Can anyone upload a .xls project please?
    Sorry for my eng :D

    Immagine.png

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    Please attach a workbook, rather than an image.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    In cell C1, enter:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy down.

  4. #4
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    attached!
    Not works functions
    I don't know why.
    Thank you Olly
    Attached Files Attached Files

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    In C2, enter:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down.

    This will still return #N/A for a lot of rows, where your source data (in column A) is unmatched or ambiguous - for example, "BELGIO" doesn't exist in column B...

  6. #6
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    I just tried right now! But still the prob, excel said me #name? in colC

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    Quote Originally Posted by ozza89 View Post
    I just tried right now! But still the prob, excel said me #name? in colC
    Please attach a workbook showing the #NAME? error, so I can see what you've entered.

  8. #8
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    I can't save the file .xsl with the function
    I attached the file without fuction
    Thks Olly
    Attached Files Attached Files

  9. #9
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    How can I help you if you don't show what you are trying??

    Let me repeat: in C2, enter;
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copy and paste this to range C3:C219.

    If this shows #N/A, it's because the value in column A for that row is not found anywhere in column B.

    If you have a different type of error, please save your workbook with the formula in, and attach that.

  10. #10
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    Hi Olly thanks for the help CERCA.VERT is the translation of VLOOKUP

    countries_07013.xlsx

  11. #11
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    You've not entered the formula exactly as I typed it.

    In cell C2 you have put:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I told you to put:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See the difference? You've ommitted the column index number parameter. You've also entered the lookup range as a relative reference.

    Try using EXACTLY what I showed you.

  12. #12
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    45.jpg

    Ok, but isn't working ^^

  13. #13
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: compare two columns and return match from third column

    <sigh>

    I think I'm out of this one...

  14. #14
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    Last edited by ozza89; 03-07-2014 at 10:42 AM.

  15. #15
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: compare two columns and return match from third column

    try this one

    =VLOOKUP("*"&SUBSTITUTE(LEFT(A2,5),"*","")&"*",$B$2:$B$285,1,0)
    Last edited by AlKey; 03-07-2014 at 10:47 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  16. #16
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: compare two columns and return match from third column

    hi,
    follow what Olly said and it works!
    Attached Files Attached Files
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

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

    Re: compare two columns and return match from third column

    Are you using a foreign language version of excel and putting the formulas in as they are for English versions?

  18. #18
    Registered User
    Join Date
    02-15-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: compare two columns and return match from third column

    also see find or search and match function for it.

  19. #19
    Registered User
    Join Date
    02-15-2014
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: compare two columns and return match from third column

    =VLOOKUP("*"&LEFT(A2,4)&"*",$B$2:$B$247,1,FALSE).......... try this also

  20. #20
    Registered User
    Join Date
    03-05-2014
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: compare two columns and return match from third column

    =CERCA.VERT("*"&ANNULLA.SPAZI($A3)&"*";$B:$B;1;FALSO)

    wORKED LIKE A CHARM THANK 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. Compare 2 columns and return the best match
    By uberathlete in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-27-2013, 06:44 AM
  2. [SOLVED] Compare data in columns of two worksheets and return value if match.
    By Zoediak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2013, 10:38 AM
  3. Replies: 20
    Last Post: 04-15-2013, 01:06 PM
  4. How to compare columns and return one value if they match
    By louise0502 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2013, 11:10 AM
  5. Compare values in 2 columns, return Y/N in a third column
    By creed1101 in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 07-08-2009, 01:29 PM

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