How to find second to last non blank value in a row excel
<p>I have data in Y:AI, and return the last non blank value in AJ</p>

<pre><code>L0  L1  L2  L3  L4  L5  L6  L7  L8  L9  L10 Last Code
GP                                          GP
GP  CF  TF                                  CF
GP  CF  TF                                  TF
GP  CF  EX                                  EX
GP  CF  EX  EX1                             EX1
GP  CF  EX  EX2                             EX2
GP  CF  DG                                  DG
GP  CF  DG  DGA                             DGA
GP  CF  DG  DGB                             DGB
GP  CF  DG  DGC                             DGC
GP  CF  DG  DGD                             DGD
GP  CF  DG  DGE                             DGE
</code></pre>

<p>I return the last value in AJ3 for example, by using: </p>

<pre><code>=LOOKUP(2,1/(Y3:AI3&lt;&gt;0),Y3:AI3)
</code></pre>

<p>I have tried two different ways to return the second to last non blank value.</p>

<pre><code>=LOOKUP(2,1/(Y3:AI3&lt;&gt;AK3),Y3:AI3)
=LOOKUP(2,1/(or(Y3:AI3&lt;&gt;0, Y3:AI3&lt;&gt;AJ3),Y3:AI3)
</code></pre>

<p>The first case returns the value in AI, the second case returns either the value in Y, or a #DIV0! error.</p>

<p>Any help in this would be greatly appreciated.</p>