title: Excel Formula return the value beside the latest date
body: <p>I want to return the Card used to B2 based on the table to the right.</p>
  
  <p>This returned value should be of the latest date(column G), and the cell to the left of the date should not be blank. If it is blank, return the next latest value.</p>
  
  <p>I have this formula but I want it to return Bank B onto B3 instead of "0" how do i go about achieving this?</p>
  
  <pre><code>   =INDEX($F$2:$F$7, MATCH(A2 &amp; MAX(IF($E$2:$E$7=A2,$G$2:$G$7)), $E$2:$E$7 &amp; 
    $G$2:$G$7, 0))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KCNdL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KCNdL.png" alt="enter image description here"></a></p>