Skip to content Skip to sidebar Skip to footer

Compare Sheet 1 To Sheet 2 And Output To Sheet 3. Google Sheets. Javascript

The following code works successfully to compare column A of sheet 2 with Column B of sheet 1, any matches will copy the entire row to sheet 3. However im needing a very slight cha

Solution 1:

  • You want to retrieve the values of "Sheet1" and "Sheet2".
  • You want to compare the column "N" of "Sheet1" and the column "A" of "Sheet2". When the values of the column "N" of "Sheet1" and the column "A" of "Sheet2" are the same, you want to retrieve the row of "Sheet1" and put to "Sheet3".
  • You want to achieve this by modifying your script.

Modification point:

  • var resultArray = values1.filter(([,b]) => b in obj); is modified. In your current script, the column "B" from [,b] is compared.

Modified script:

When your script is modified, please modify as follows.

From:
var resultArray = values1.filter(([,b]) => b in obj);
To:
var resultArray = values1.filter(b => b[13] in obj);

Post a Comment for "Compare Sheet 1 To Sheet 2 And Output To Sheet 3. Google Sheets. Javascript"