0

I'm working to create an Apps Script to automate some of my tasks at work. I am able to get the desired results with the g-sheet equation: =ARRAYFORMULA(VLOOKUP(A2:A2000,UNIQUE(QUERY({A2:A2000,F2:F2000,I2:I2000},"SELECT Col1, Col2, Col3 WHERE Col3 = 'Employee'", 0)),2,FALSE))

which works in 3 parts:

  1. Query: returns only the unique "Employee" values for columns A, F, & I.
  2. V-Lookup: Returns the 2nd index of the query based on matching e-mails.
  3. Array Formula: Returns all values for the entire array in column A.

However, I need to convert the functions above to an Apps Script acceptable format, and where the result of the script would be to return an array containing the values. I have been searching around to find something similar, but have not had much luck with it.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Baiano42
  • 33
  • 6
  • do you have a sample on how your data is structured? – David Salomon Mar 07 '22 at 17:00
  • Bruce McPherson has a series of articles about converting Google Sheets formulas into Google Apps Script code see https://ramblings.mcpher.com/apps-script/sheets-functions/. If you need further help, please make your question more specific, show what you have tried and add a brief description of your search efforts as is suggested in [ask]. – Rubén Mar 07 '22 at 23:16
  • Related https://stackoverflow.com/q/16303680/1595451 (previous to the above referred articles) – Rubén Mar 07 '22 at 23:18

0 Answers0