title: Retrieve last n rows based on one numeric column in google sheet
body: <p>My data looks like this:</p>
  
  <pre><code>+---------------+-----+-----+------+-----+-----+
  | Serial Number | LSL | LCL | DATA | UCL | USL |
  +---------------+-----+-----+------+-----+-----+
  |             1 |   1 |   3 | 2.3  |   7 |   9 |
  |             2 |   1 |   3 | 3.1  |   7 |   9 |
  |             3 |   1 |   3 | 2.7  |   7 |   9 |
  |             4 |   1 |   3 | 4.9  |   7 |   9 |
  |             5 |   1 |   3 | 5    |   7 |   9 |
  |             6 |   1 |   3 | 3    |   7 |   9 |
  |             7 |   1 |   3 | 10   |   7 |   9 |
  |             8 |   1 |   3 | 7.8  |   7 |   9 |
  |             9 |   1 |   3 |      |   7 |   9 |
  |            10 |   1 |   3 | 6.8  |   7 |   9 |
  |            11 |   1 |   3 | 10   |   7 |   9 |
  |            12 |   1 |   3 | 3.9  |   7 |   9 |
  |            13 |   1 |   3 | 11.3 |   7 |   9 |
  |            14 |   1 |   3 |      |   7 |   9 |
  |            15 |   1 |   3 |      |   7 |   9 |
  |            16 |   1 |   3 |      |   7 |   9 |
  |            17 |   1 |   3 |      |   7 |   9 |
  |            18 |   1 |   3 |      |   7 |   9 |
  |            19 |   1 |   3 |      |   7 |   9 |
  |            20 |   1 |   3 |      |   7 |   9 |
  +---------------+-----+-----+------+-----+-----+
  </code></pre>
  
  <p>I want to query last 7 rows data where the DATA column is not empty. Trying to achieve something like this:</p>
  
  <pre><code>+----+---+---+------+---+---+
  |  7 | 1 | 3 | 10   | 7 | 9 |
  |  8 | 1 | 3 | 7.8  | 7 | 9 |
  |  9 | 1 | 3 |      | 7 | 9 |
  | 10 | 1 | 3 | 6.8  | 7 | 9 |
  | 11 | 1 | 3 | 10   | 7 | 9 |
  | 12 | 1 | 3 | 3.9  | 7 | 9 |
  | 13 | 1 | 3 | 11.3 | 7 | 9 |
  +----+---+---+------+---+---+
  </code></pre>
  
  <p>But currently, I am only able to get the last 7 rows data which looks like this:</p>
  
  <pre><code>+---------------+-----+-----+------+-----+-----+
  | Serial Number | LSL | LCL | DATA | UCL | USL |
  +---------------+-----+-----+------+-----+-----+
  |            14 |   1 |   3 |      |   7 |   9 |
  |            15 |   1 |   3 |      |   7 |   9 |
  |            16 |   1 |   3 |      |   7 |   9 |
  |            17 |   1 |   3 |      |   7 |   9 |
  |            18 |   1 |   3 |      |   7 |   9 |
  |            19 |   1 |   3 |      |   7 |   9 |
  |            20 |   1 |   3 |      |   7 |   9 |
  +---------------+-----+-----+------+-----+-----+
  </code></pre>
  
  <p>The formula I used is:</p>
  
  <pre><code>=SORT(QUERY(Sheet1!A7:F,"order by A desc limit 7"),1,1)
  </code></pre>
  
  <p>This formula does not incorporate the condition that the last row of DATA column must not be empty. Is there a way to achieve what I am looking for?</p>