title: I am trying to write a program where it the inputs from a google form will match with a list in spreadsheet,and add the quantities together
body: <p>I am trying to match 2 variables(one taken from form submission and one is in the data base),and then add their quantities together. Is there any tips or advise on it?</p>
  
  <p>Initially I tried doing it the opposite way. Which was having the list(over 2000 things) search the data from form submissions and then add it together. I realize that it will be too laggy that way,thus this solution,but i have no idea how I can start on it.</p>
  
  <pre><code> if(input1 == database1){
  var qty_database1 = qty_database1 + qty_input1 ;
  
  }
  
   if(input1 == database2){
  var qty_database2 = qty_database2 + qty_input1 ;
  
  }
  </code></pre>
  
  <p>By doing this way,I will have to make each of the 35 inputs(all from form submission,not all 35 might have values) check against 2000+ variables(taken from the data base),which is not effective.I tried searching around on the web but cant seem to find what i need.</p>
  
  <p>Here is the link :<a href="https://docs.google.com/spreadsheets/d/1t3-AD8A0i4MZLWPh9PIR9CZYYkzb3vz2u2nNKcQPY2g/edit?usp=sharing" rel="nofollow noreferrer">Spreadsheet of data collected</a>
  "Total Defects by departments" is the database,where all information will be stored.
  The other tabs are all 3 form submissions spreadsheets.
  If there is a similar "S No." &amp; "ID No." in the 1st/2nd/3rd AQL,it will only take the last set of values,in the order of 3rd,2nd &amp; lastly 1st.</p>