title: LibreOffice MATCH produces an NA result for some cell ranges, and an incorrect result for others
body: <p>I have a weird LibreOffice Calc problem. I have a table of chapters from the five published books in the A Song of Ice and fire series. Here is a facsimile:</p>
  
  <pre><code>      A                      B
  1   | Book                 | Chapter
  ----+----------------------+-------
  2   | A Game of Thrones    | 0
  3   | A Game of Thrones    | 1
  ...
  75  | A Game of Thrones    | 73
  76  | A Clash of Kings     | 0
  77  | A Clash of Kings     | 1
  ...
  147 | A Storm of Swords    | 0
  ...
  230 | A Feast for Crows    | 0
  ...
  276 | A Feast for Crows    | 46
  277 | A Dance with Dragons | 0
  ...
  350 | A Dance with Dragons | 73
  </code></pre>
  
  <p>I'm using a <code>MATCH</code> and <code>OFFSET</code> formula to find the last chapter in every book, by first <code>MATCH</code>ing the last row for a value in the Book column, then getting the value from the Chapter column. So, to find the last chapter in A Game of Thrones:</p>
  
  <pre><code>=OFFSET("A Game of Thrones", MATCH(A4, A2:A350, 1), 0)
  </code></pre>
  
  <p>Then this would output 73.</p>
  
  <p>This works for the first three books. A Feast for Crows and A Dance with Dragons don't work. When I run the <code>MATCH</code> formula:</p>
  
  <pre><code>=MATCH("A Feast for Crows", A2:A350, 1)
  </code></pre>
  
  <p>It should return 276, which is the number of the last row with the value "A Feast for Crows", but it returns <code>#N/A</code>. However, when I use the range <code>A75:A350</code>, it returns <code>72</code>. If I use <code>A76:A350</code>, it returns <code>71</code>, and so on, with the output decreasing as the lower limit increases. Until I change the range to <code>A110:A350</code>, where the value becomes <code>167</code> (again decreasing, inversely proportional to the lower limit of the range.) The search criterion is correct, there are no leading or trailing spaces or miscapitalised words. I'm using LibreOffice Calc 4.3.1.2.</p>
  
  <p>The results of the <code>MATCH</code> are baffling me; I don't know why it's not outputting correctly. Can you suggest what's gone wrong here?</p>