• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Compare data in 2 sheets

Poppy12

New Member
Hello

I have 2 Sheets

Sheet 1 Column A, contains values I wish to search for matches in Sheet 2 Column A
If a match is found I wish to pull in data from Columns B,C & D from Sheet 2 into Sheet 1 for the corresponding match in Column A
For any data in Sheet 1 Column A that doesn't have a match in Sheet 2, I want to see an 'ERROR' message or similar

I'm not an Excel expert so is there a reason the attached file isn't working? Is it due to cells with no data on Sheet 2?

Thankyou
 

Attachments

  • Book1.xlsx
    18.5 KB · Views: 1
Apologies, I didn't include all the data
I've added some additional data but the formula doesn't seem to be working
 

Attachments

  • Book 1.xlsx
    453.9 KB · Views: 1
i would use an index match
not sure what you have now - as data is all over the sheets
based on
Sheet 1 Column A, contains values I wish to search for matches in Sheet 2 Column A
If a match is found I wish to pull in data from Columns B,C & D from Sheet 2 into Sheet 1 for the corresponding match in Column A

this will return the contents of column B
=INDEX(Sheet2!$B:$B,MATCH(Sheet1!A2,Sheet2!$A:$A,0))
where there is a match
to get an error message when NO match then
=IFERROR(INDEX(Sheet2!$B:$B,MATCH(Sheet1!A2,Sheet2!$A:$A,0)), "Error")
as i have used in column AO

to get C and D
=INDEX(Sheet2!$C:$C,MATCH(Sheet1!A2,Sheet2!$A:$A,0))
=INDEX(Sheet2!$D:$D,MATCH(Sheet1!A2,Sheet2!$A:$A,0))

then wrap in an IFERROR ()
=IFERROR(INDEX(Sheet2!$B:$B,MATCH(Sheet1!A2,Sheet2!$A:$A,0)), "Error")

i have just added the first formula in cell AO , as i did not know where you wanted the results to be put as you have data in a lot of columns
 

Attachments

  • index-match-ETAF.xlsx
    456 KB · Views: 3
Back
Top