Search code examples
excelexcel-formulaexcel-2010excel-2007

copy Column B of sheet2 by matching values of Column A from sheet2 to Column A sheet1


I have a complex scenario, I want to copy Column B of sheet2 to Column C of sheet1 by match cells of column A of sheet2 against Column A sheet1, please have a look at below tables.

Sheet 1

enter image description here

Sheet 2

enter image description here

Resultant Sheet 1 After formula

enter image description here


Solution

  • Its no so complex. Try Index/Match like-

    =IFERROR(INDEX(Sheet2!B:B,MATCH(A2,Sheet2!A:A,0)),"")
    

    VLookup() will also work in this way-

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

    With Excel365, single XLOOKUP() will give you desired result.

    =XLOOKUP(A2,Sheet2!A:A,Sheet2!B:B,"")
    

    enter image description here