title: Using MATCH() function with an unsorted list
body: <p>I'm having an issue with a spreadsheet formula that uses the MATCH() function.</p>
  
  <pre><code>=IFERROR(IF(LENB(Y2461)&lt;&gt; 0, "Complete", IF(LENB(Q2461)&lt;&gt; 0, IF(Q2461-$Y$1&lt;MATCH($Y$1,R2461:X2461),"ON HOLD"), INDEX($R$4:$X$5,1,MATCH($Y$1,R2461:X2461)))),"ON HOLD")
  </code></pre>
  
  <p>This is the formula in the cell with the specific problem. I'm using match to look through a horizontal range of data and determine which column contains the most recent change, with exceptions for when the "Complete" column has a date, and the "ON HOLD" column has a date. Cell Y1 contains <code>=TODAY()</code>, so it checks each cell against today's date. The cells are formatted into dates, and are entered as dates from left to right. However, the entries can start again from an earlier column and leave the dates out of order.</p>
  
  <p>The issue is, on only a few occurrences at a time, <code>MATCH()</code> will return a column that isn't the most recent. As far as I've been led to believe, and how it works for the other instances of this formula, is that it reads the array from right to left and stops at the first "highest" date.</p>
  
  <p>The error is occurring on one row specifically, while the expected result works multiple times elsewhere on the sheet.</p>
  
  <p>Am I using <code>MATCH()</code> wrong by assuming that it will read in a certain direction every time? Is there a different error in the code? Or is there a different way to get the result I've programmed it for?</p>