title: How to find index of the first match in the column using Google sheets script?
body: <p>I'm trying to find index of the first match in the column using Google sheets script:</p>
  
  <pre><code>function getRowIndex() {
    var lookupValue = "car";
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheetByName("List");
    var lastRow = sheet.getLastRow();
    var lookupRangeValues = sheet.getRange(1, 1, lastRow, 1).getValues()[0];
    var index = lookupRangeValues.indexOf(lookupValue);
    Logger.log(index);
  }
  </code></pre>
  
  <p>But my code returns -1 always. What am I doing wrong?</p>