+ Reply to Thread
Results 1 to 5 of 5

Compare two columns from one sheet to two columns in other sheet and fill third column

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Compare two columns from one sheet to two columns in other sheet and fill third column

    Dear All,

    This is my first post here.

    I have two sheets and I want to compare values in two columns of sheet1 to values in two columns of sheet 2. When ever both the values match, I want to write corresponding third column value from sheet 1 to sheet 2.

    Here I go ..

    Sheet 1:
    Product Customer Market
    Type A HUTCHINSON parts
    Type B NP PODOLSKKABEL OAO auto
    Type V TISSAN OOO fuel line
    XYZ INTELS OOO pipes


    Sheet 2:
    Product Customer Market
    Type A HUTCHINSON
    Type B NP PODOLSKKABEL OAO
    Type Z TISSAN OOO
    Product A INTELS OOO
    Type B ABC
    Type V TISSAN OOO
    XYZ INTELS OOO


    I want to fill third column in sheet 2 after comparing values with sheet 1 ...

    I want to get something like following in the "market" column ..

    Product Customer Market Expected result
    Type A HUTCHINSON parts
    Type B NP PODOLSKKABEL OAO auto
    Type Z TISSAN OOO
    Product A INTELS OOO
    Type B ABC
    Type V TISSAN OOO fuel line
    XYZ INTELS OOO pipes

    Please can you help me with any formulae or something that helps me to get expected result?

    Thanks,
    Prashant

    Experiment.xls

  2. #2
    Registered User
    Join Date
    03-06-2012
    Location
    seattle, USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Compare two columns from one sheet to two columns in other sheet and fill third column

    I am not sure if the following is the best solution for your problem. You can use it till any one else provide better solution. :-)

    Step1:

    Copy formula =VLOOKUP(A2,sheet1!A:A,1,0) in cell E2 and drag downwards

    Step2:

    Copy formula =VLOOKUP(B2,sheet1!B:B,1,0) in cell F2 and drag downwards

    Step3:

    Copy formula =IF(AND(E2<>"",F2<>""),VLOOKUP(E2,sheet1!A:C,3,0),"") in cell C2 and drag downwards

    Hope this helps you.


    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below.

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Compare two columns from one sheet to two columns in other sheet and fill third column

    Thanks reddy. This helps a lot.

  4. #4
    Registered User
    Join Date
    03-06-2012
    Location
    seattle, USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Compare two columns from one sheet to two columns in other sheet and fill third column

    You are welcome Prashant.


    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below.

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    03-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Compare two columns from one sheet to two columns in other sheet and fill third column

    Reddy,

    There is a problem with the solution. When it matches the first value and does not match the second value then it produces the wrong result. Please see attached excel (ver02) file.

    Thanks,
    Prashant
    Attached Files Attached Files

+ 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