title: How can I find the closest matching value ABOVE the current cell, and return a different column in that same row?
body: <p>Working in google sheets, I am trying to find the closest matching value ABOVE the current cell and return a different column from that same row.</p>
  <p>Here is a visual of what I'm trying to achieve:</p>
  <p><a href="https://i.stack.imgur.com/QraJ7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QraJ7.png" alt="Here is a visual of what I'm trying to achieve." /></a></p>
  <p>For any row where Column A=x, just return the value in Column B to Column &quot;Results&quot;. If Column A does <strong>not</strong> equal x, I want to return the closest (in distance) Column B value where Column A=x <strong>above</strong> the current row. The first part (where Column A=x) is simple, but I'm having trouble with the second part, where Column A &lt;&gt; x. I've tried various iterations of index match, vlookup, but I keep ending up with either the first or last match, rather than the closest (in distance) above.</p>
  <p>Thank you so much!</p>