title: Excel, Specifying cell contents as a result of other cells
body: <p>I don't use excel often, and I haven't really found a good solution to my problem. (which is probably really simple). </p>
  
  <p>I would like to have a cell with a function in my spreadsheet that shows another cell value value that depends on yet another cell value. </p>
  
  <p>Such as:</p>
  
  <p><img src="https://i.stack.imgur.com/Yzb9Z.jpg" alt="enter image description here"></p>
  
  <p>The <strong>Best Deal</strong> heading simply uses the formula </p>
  
  <pre><code>=MAX(D3,D1000)
  </code></pre>
  
  <p>But under Best Deal I would like to display the Name Test1 rather than the numeric value. </p>
  
  <p>Another thing that would be nice to know, is if there is a way to know the maximum row with data in it. So rather than <code>=MAX(D3,D1000)</code> something like <code>=MAX(D3,Max(RowCount_InD))</code> </p>
  
  <p>Obviously that function wouldn't work as I wrote it, but hopefully this pseudo code gives you an idea of what I mean. The purpose is that if more entries are added, it would be able to handle them. </p>
  
  <p>I know this is possible, but I'm having some trouble. Hopefully I can get some help here. </p>
  
  <p>Thanks!</p>