+ Reply to Thread
Results 1 to 11 of 11

Match 2 columns in 2 sheets and return the 3rd column

  1. #1
    Registered User
    Join Date
    03-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    8

    Match 2 columns in 2 sheets and return the 3rd column

    Hi,

    I have to match 2 columns with 2 columns of other sheet and return the 3rd column value from the second sheet to the first sheet. Tried MATCH but has result has multiple values. Here are the details

    Sheet 1

    Column I and Column K values should match with

    Sheet 2

    Column N and Column B to get the coulmn F value.

    But the catch is that Column N and B would return 2 rows with Column F values either 0 or any value. I need to take the row with the column F value and not the 0.

    How can i do that using excel formulae?

    Thanks
    Last edited by NBVC; 03-17-2011 at 07:36 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Match 2 columns in 2 sheets and return the 3rd column

    Perhaps something like:

    =SUMPRODUCT(--('Sheet2'!$N$2:$N$100=I2),--('Sheet2'!$B$2:$B$100=K2),'Sheet2'!$F$2:$F$100)

    adjust ranges to suit (can't use whole columns with this formula in XL2003).
    Where there is a will there are many ways.

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

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

  3. #3
    Registered User
    Join Date
    03-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Match 2 columns in 2 sheets and return the 3rd column

    Thanks for the reply

    what does the -- indicate? If i do a product the result would be 0 isnt it as there is a zero value to the resultset?

    Thank you

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Match 2 columns in 2 sheets and return the 3rd column

    The -- coerces the TRUE/FALSE results to 1's and 0's then these arrays are multiplied together to get results of 1's and 0's, then the 1/0 array is multiplied by the results and where the 1 matches a number in column F, that value will be cumulatively summed.

  5. #5
    Registered User
    Join Date
    03-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Match 2 columns in 2 sheets and return the 3rd column

    Unfortunately I am not getting the expected value.

    Attached is the sample sheet. Can you explain?

    Thank you!
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Match 2 columns in 2 sheets and return the 3rd column

    The ranges should all be the same size.. you were using C:C to sum against small check ranges... and you didn't put in the $ signs.

    Try:

    =SUMPRODUCT(--(Sheet1!$A$2:$A$13= Sheet2!A2),--(Sheet1!$B$2:$B$13=Sheet2!B2),Sheet1!$C$2:$C$13)

    also, column A of Sheet1 has many extra spaces at the ends of the entries.

    Try removing them, you can do Ctrl+H and then Find What: enter a space and click Replace All.

  7. #7
    Registered User
    Join Date
    03-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Match 2 columns in 2 sheets and return the 3rd column

    I have done all the changes that you have mentioned but the end result is 0 instead of 1200.

    I guess the prodcut is part is being multiplied by 0

    Please help.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Match 2 columns in 2 sheets and return the 3rd column

    After following the instructions I gave you, the attached should be the result.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    8

    Thumbs up Re: Match 2 columns in 2 sheets and return the 3rd column

    Thank you!! That worked!!!

  10. #10
    Registered User
    Join Date
    03-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    8

    Thumbs up Re: Match 2 columns in 2 sheets and return the 3rd column

    Thank you!!

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Match 2 columns in 2 sheets and return the 3rd column

    You are welcome,

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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