title: Excel: vector-style lookup function without sorting
body: <p>I have an Excel (2007) spreadsheet which consists of several rows with the first few something like this:</p>
  
  <pre><code>CL    DH    HL    SP    FR    CB    TQ    TT
  37    33    27    27    26    25    31    26
  25    26    33    32    28    25    26    25
  21    28    26    31    26    28    26    28
  </code></pre>
  
  <p>They need to appear in this order since the first row also functions as headings for the columns.</p>
  
  <p>What I need is to find the maximum number in each row, and to then return the column heading, i.e. for the data here the max in the first row is 37 so it returns CL, then HL and SP and so on.</p>
  
  <p>Using the LOOKUP function in vector form requires the lookup row to be sorted (which isn't possible here since the order of each row is different and they all use the same headings), so I can't use that. Using HLOOKUP does not need data to be sorted but requires that the lookup row is the first row of an array, which again isn't practical here since I need the headings at the top.</p>
  
  <p>Basically, what I think I need is a lookup-type function which uses vectors rather than a single array but does not require sorted data. Is this possible?</p>