Simple Google Sheet Search For Rows Do Not Find Empty Row

I am confused due to the fact that I keep getting no result when trying to find the 1st empty row. It works fine with some other spreadsheet, but it doesn’t with a new ones. I created a test scenario with a brand new sheet in order to present the problem.

Here is the Module:

Here is the google sheet. I made sure that all the cell are empty.

The output always goes like this:

What am I missing here??

You won’t get an empty row in the API when looking for a blank column if all columns are blank because the Google Sheets API does not treat fully empty rows as part of the data range, thus ignoring them in queries.

However we can work around this.
By:

  1. search by your key row where this row exists. For my example A is my key row.
  2. Make sure to sort order by descending
  3. Order by row number
    Now we will receive the last row number with a value in it

  1. Now take the max row number and add one to get the next row which is our first blank row.


image

good luck let me know if this help!

3 Likes

Now I understand why I couldn’t get it done :slight_smile:

Your solution works perfectly, Thanks a lot!!!

2 Likes

Great can you please mark as solution so other with the same issue may be able to find this. Thank you!

2 Likes