Forum Discussion

ethinix's avatar
ethinix
Copper Contributor
Nov 11, 2023
Solved

Match Column A of One Excel File with Column A of another Excel File and copy Data

Hello Community,

Please help me out with this.

I have two Excel files. I want to match Column A of one file with Column A of another file. If both are same, I want to copy data in Columns B,C,D,E of the first file to the other file.

I am not good at macros. If you are suggesting macros, please add a note as to how to deploy the macros.

  • Hi ethinix 

     

    Assuming your 2nd file has a header (as below) in row 1 and the values you want to match (in your 1st file) start in row 2:

     


    in B2 of your 2nd file:

    =XLOOKUP(A2, 'File 1'!A:A, 'File 1'!B:E, "No match")


    Sample attached ('File 1' and 'File 2' are in the same workbook for simplicity)

8 Replies

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Hi ethinix 

     

    Assuming your 2nd file has a header (as below) in row 1 and the values you want to match (in your 1st file) start in row 2:

     


    in B2 of your 2nd file:

    =XLOOKUP(A2, 'File 1'!A:A, 'File 1'!B:E, "No match")


    Sample attached ('File 1' and 'File 2' are in the same workbook for simplicity)

    • ethinix's avatar
      ethinix
      Copper Contributor

      Lorenzo 

      Thanks for the quick response. Here's what I want to achieve.

       

  • rachel's avatar
    rachel
    Steel Contributor

    ethinix 

     

    Hi,

     

    I think you can just use CHOOSEROWS function to copy entire row from one file to another.

     

    I attached an example. Book1.xlsx is where the original data sits. Book2 is the file you want to copy data to. 

     

    • ethinix's avatar
      ethinix
      Copper Contributor
      Thanks for the quick response. Please check the image I posted below. That's what I want to achieve.

Resources