Finding the last value in a row
<p>I have a row containing data in sets of four cells; port code, distance override, time of arrival and time of departure. The distance override columns can be empty.</p>

<p>The idea is to populate columns F and G with the first and last ports in the list (to feed to a filter system in a userform that's so beyond me that I'm trying not to think about it for now).</p>

<p><a href="https://i.stack.imgur.com/KXg1f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KXg1f.png" alt="Column example"></a></p>

<p>The cell in column F is a simple reference to column H. I used the method from <a href="https://exceljet.net/formula/get-value-of-last-non-empty-cell" rel="nofollow noreferrer">Last value</a> (<code>=LOOKUP(2,1/(3:3&lt;&gt;""),3:3)</code>) to get the last value in the row, which works fine. Unfortunately the last value is the time of departure, while what I need is the port code. I've tried adding <code>-3</code> in a few different places in the formula, but I can't seem to make it go...</p>

<p>I <em>could</em> adjust the order of the columns to put the port code at the end, but I'd like to keep it as it is as the task spec stipulates this order.</p>

<p>Can anyone help?</p>