Forum Discussion

DelpS's avatar
DelpS
Copper Contributor
Nov 21, 2022

If cells match copy data

I am looking for a way to merge the data in two separate sheets within the same workbook (treatments and payments associated to treatments).  If column a, b and c of sheet 1 match column a, b and c of sheet 2, copy the data from column d, e and f from sheet 1 to column d, e and f on sheet 2.

  • DelpS 

    =INDEX('sheet 1'!D$2:D$23,MATCH(1,('sheet 1'!$A$2:$A$23='sheet 2'!$A2)*('sheet 1'!$B$2:$B$23='sheet 2'!$B2)*('sheet 1'!$C$2:$C$23='sheet 2'!$C2),0))

    You can try INDEX and MATCH. Enter the formula with ctrl+shift+enter if you don't work with Office365 or Excel 2021.

     

    In the example the formula is in cell D2 and filled across range D2:F23.

     

Resources