title: Lookup last entry in each set in Excel
body: <p>In Excel, if I have the following data in <code>Table1</code>:</p>
  
  <pre><code>Name  | Hobby
  ===============
  James | Cooking
  Phil  | Swimming
  Phil  | Golfing
  Eric  | Working
  Eric  | Running
  Eric  | Boarding
  </code></pre>
  
  <p>And the following <code>table2</code>:</p>
  
  <pre><code>Hobby    | Category
  ====================
  Cooking  | Not Available
  Swimming | Available
  Golfing  | Available
  Working  | Not Available
  Running  | Available
  Boarding | Available
  </code></pre>
  
  <blockquote>
    <p>How do I return the <code>category</code> from <code>table2</code> of the <strong><em>last</em></strong> <code>hobby</code> per <code>name</code> in <code>table1</code>?</p>
  </blockquote>
  
  <p>Ideally I get a result in an array/range that looks like:</p>
  
  <pre><code> (Categories)
  {"Not Available";   (Cooking from James)
   "Available";       (Golfing from Phil)
   "Available"}       (Boarding from Eric)
  </code></pre>
  
  <p>I know I can use <code>vlookup</code> or <code>index-match</code> to do a normal lookup to get the <code>category</code> of each <code>hobby</code>, but in this case, I am specifically interested in getting the <strong><em>last</em></strong> <code>hobby</code> per <code>name</code>, which I have not been able figure out or find after some searching.</p>
  
  <p>Note, <code>Table1</code> may include blank <code>names</code> and/or <code>hobbies</code>. But the <code>names</code> themselves are grouped/sorted together.</p>