Forum Discussion

zwernick's avatar
zwernick
Copper Contributor
Aug 07, 2022

Merging Tables

I have two sheets. Sheet2 has 1741 rows and Sheet1 has 324. Sheet1 column A has id numbers that all exist in Sheet2 column D. I want to append the text cells (Columns $B:$H) from sheet1 to the matching rows in sheet2. I have tried multiple formulas and keep getting error with formula messages. I have tried using vlookup and other functions, but I cannot get it to work. 

 

Formula's I have tried based on other threads:

=VLOOKUP($D2,'sheet1'!$A2$H324,2,FALSE)


But that calculates some number that I have no idea where it came from.

 

I wouldn't think a task like this would require additional sql queries or connecting to a database etc. All of the data is static information in the excel workbook.

4 Replies

  • zwernick 

    =VLOOKUP($D2,sheet1!$A$2:$H$324,COLUMN(B:B),FALSE)

    This formula works in my sheet. An alternative could be INDEX and MATCH.

     

  • A small sample data would be helpful to understand you query, please manually type your desired result
    Regards, Faraz Shaikh
    • zwernick's avatar
      zwernick
      Copper Contributor

      Sheet1:

      receipt-number, customerid, name of piped customer, value date, amount, comments, name on receipt
      ex:
      1, 12345, Smith John, August 7, $500, for project X, ABC Inc
      4, 56789, Smith Jane, August 3, $100, for project Y, XYZ Inc
      7, 12345, Smith John, August 2, $500, for project X, W Inc

      Sheet2:
      A, B, C, D
      name, receipt date, receipt name, receipt number, columns E-AJ have additional data pieces
      row 2 starting with Receipt number (column d)
      1
      2
      3
      4
      5
      6
      7

      solution should be on sheet2: D, Columns AK+
      1 ,12345, Smith John, August 7, $500, for project X, ABC Inc
      2, AK+ leave blank
      3. AK+ leave blank
      4, AK=56789, Smith Jane, August 3, $100, for project Y, XYZ Inc

Resources