+ Reply to Thread
Results 1 to 4 of 4

If match between two sheets, copy adjacent cell from sheet 2 to sheet 1?

  1. #1
    Registered User
    Join Date
    09-13-2011
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007/ 2010
    Posts
    7

    If match between two sheets, copy adjacent cell from sheet 2 to sheet 1?

    Hi,
    I’m trying to compare two sheets. On both sheets are product codes (both in column A) of which some are matching. When a product code matches I want the adjacent cell on sheet 2 (column B, price) to be copied to the column C on sheet 1 (in the same row as the matched name).

    I have searched quite a lot to find a (suitable) solution but I have failed so far.

    Thanks in advance.

    Best regards

    Maarten

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

    Re: If match between two sheets, copy adjacent cell from sheet 2 to sheet 1?

    You can use VLOOKUP or SUMIF

    e.g

    =IFERROR(Vlookup(A2,'Sheet2'!A:B,2,FALSE),"")


    or

    =SUMIF('Sheet2'!A:A,A2,'Sheet'!B:B)

    The Vlookup finds the first (and if unique, only) match. If not found it returns a blank.

    The Sumif finds all matches (and if unique, only match). If not found it returns a 0.
    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
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If match between two sheets, copy adjacent cell from sheet 2 to sheet 1?

    Hi,

    You need to use VLOOKUP() in Sheet1 column C. e.g.

    Please Login or Register  to view this content.
    obviously change the B100 to cover your actual range in sheet2.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    09-13-2011
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007/ 2010
    Posts
    7

    Re: If match between two sheets, copy adjacent cell from sheet 2 to sheet 1?

    Thank you both, I had already tried vlookup but I made an error in the table array. Now it works!

    Best regards

    Maarten

+ 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