title: Google Apps Script - Find Row number based on a cell value
body: <p>I'm looking for some assistance on find the row number for a cell that contains a specific value.</p>
  
  <p>The spreadsheet has lots of data across multiple rows &amp; columns.  I'm looping over the .getDataRange and can located the cell containing the value I'm looking for.  Once found I'd like to know the row that his cell is in, so that I can further grab additional cell values since I know exactly how many rows down and/or columns over the additional information is from the found cell.</p>
  
  <p>Here is a bit of the code for finding the cell containing a specific string.</p>
  
  <pre class="lang-js prettyprint-override"><code>function findCell() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getActiveSheet();
    var dataRange = sheet.getDataRange();
    var values = dataRange.getValues();
  
    for (var i = 0; i &lt; values.length; i++) {
      var row = "";
      for (var j = 0; j &lt; values[i].length; j++) {     
        if (values[i][j] == "User") {
          row = values[i][j+1];
          Logger.log(row);
        }
      }    
    }  
  }
  </code></pre>
  
  <p>When outputting <code>Logger.log(row)</code> it gives me the values I'm looking for.  I want to determine what row each value is in, so I can then go down X number of rows and over X columns to get the contents of other cells.</p>