title: Copying data from one sheet to another based on value in a cell
body: <p>I have a Google sheet with multiple sheets.
  The Ambassador users sheet has a list of multiple users (ID, Email, Coupon, and three more irrelevant columns).
  Each new user is updated to the sheet via Zapier.
  I can have three users with coupon 1234, four with ABCD and two with XYZ.
  I then create a unique sheet for each type of coupon (also via Zapier) and want to update each sheet only with the users that have the correct coupon for that sheet.
  The coupon is also listed in cell J1 on each sheet.
  I need the update to happen automatically without pressing any buttons.</p>
  
  <p>I do not know how to use the functions on Google sheets (I understand it's different from VBA), and I though using a function would be the best solution.
  I tried using the IF function in conjunction with the INDEX function and it worked, however, it requires me to copy the function into each row, and thus reduces the automation option.</p>
  
  <pre><code>=if('Ambassador users'!$C3=$J$1, index('Ambassador users'!A3:G3),"")
  </code></pre>
  
  <p>Then I tried to use the IMPORTRANGE function, and this worked, but not in conjunction with the IF</p>
  
  <pre><code>=if('Ambassador users'!$C2=$J$1, importrange("1QHGSCR_pVepNlMtjFshvGnI-vSPzgqi3g9jz98","'Ambassador users'!A2:G11"),"")
  </code></pre>
  
  <p>This gave me all the rows in the Ambassador users sheet.</p>
  
  <p>I think I'm doing something wrong with the IF statement in the initial range I'm setting is wrong.
  I also tried to set a range in the IF, but that totally didn't work.</p>