in Education by
In one Google sheet workbook, lets say I have Sheet1 with 5 rows as Sheet1 And I have Sheet2 as Sheet2 I am looking for something that will take the non-matching rows (rows which are in Sheet2 but not in Sheet1) and append those cells below the cells in Sheet1. Expected result in Sheet1: Expected Result JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
In your situation, how about the following sample script? Sample script: function myFunction() { const ss = SpreadsheetApp.getActiveSpreadsheet(); const [sheet1, sheet2] = ["Sheet1", "Sheet2"].map(s => ss.getSheetByName(s)); const lastRowSheet1 = sheet1.getLastRow(); const sheet1Obj = sheet1.getRange("A2:B" + lastRowSheet1).getValues().reduce((o, [a]) => (o[a] = true, o), {}); const sheet2Values = sheet2.getRange("A1:A" + sheet2.getLastRow()).getValues(); const values = sheet2Values.filter(([a]) => !sheet1Obj[a]); if (values.length == 0) return; sheet1.getRange(lastRowSheet1 + 1, 1, values.length, 1).setValues(values); } When this script is run, the values of "Sheet1" and "Sheet2" are checked. When the values of column "A" of "Sheet2" are not included in the values of column "A" of "Sheet1", those values are appended to column "A" of "Sheet1". I thought that this is the goal you expect. Note: If you change the sheet name, please modify ["Sheet1", "Sheet2"]. References: getValues() setValues(values) reduce()

Related questions

0 votes
    I have the dataset that has the no_employees column that is the str object. whats is a best way to create the new ... 1-5 |Very Small Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    Mr.Iyer is an Accountant. He normally has to make balance sheet, profit and loss statements etc that need ... easily and effectively? Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    18F-AV-1451-A07 Value refer to another sheet called "CONTENT" in which column "B" and row "3". ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Lets say I have this following table: +------+-------------------------+-- ... JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have 2 data frames df1 Name 2010 2011 0 Jack 25 35 1 Jill 15 20 df2 Name 2010 2011 0 Berry 45 25 1 ... used the code df1.add(df2) Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
0 votes
    I have the function and want to create a new column df['growth_factor'] which will have a derived value in it. ... can I achieve this? Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    I am using the Google Sheets V4 Values collection and I am having trouble figuring out how to get each ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am trying to convert a string into date format in Google Sheet. I've tried different formulas but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have an excel sheet that has a data like this Position URL Company Location Developer /xyz/123/xyz ABC ... Would appreciate any help Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have an excel sheet that has a data like this Position URL Company Location Developer /xyz/123/xyz ABC ... Would appreciate any help Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I have two sheets sheet1, sheet2. Sheet2 having the with records and duplicate number. like sheet1 1--- ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I am trying to figure out how to pull only specific rows and columns using Google apps script. The ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    Match column I with column II and select the correct answer using the codes given below the columns. Column - I Political ... 2, D - 4 Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    Match the columns: Column I Column II (1) Physical, chemical and biological factors together form ( ... Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 8, 2021 in Education by JackTerrance
0 votes
    I have a dataset, say: DateJoined Name Number DateLeft 11/03/2015 Tom 001199 11/03/2019 11/03/ ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
...