What's the expected data from sheet.getDataRange().getValues()?
You are looping the data from position 1 (for var i = 1...) is that correct? Also which kind of Object is data? Is it an Array, an Object, a custom Object? You have to provide us with more information to be able to help.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop