# Last non-blank cell in reverse



## Serpher (Jan 7, 2023)

A​B​
06-01-2023 22:33​

07-01-2023 21:00​
=A4-[last non blank cell]

Objective is to find last non-blank cell value looking from current row in reverse. Amount of blank cells from current row can vary.


----------



## Flashbond (Jan 7, 2023)

Do you mean row or column? Can you give a more specific example? Last non-blank cell in column A (to the Down) or last non-blank cell in Row 4 (to the Right)?


----------



## Serpher (Sunday at 4:44 AM)

Last non-blank cell in column A.


----------



## Flashbond (Sunday at 4:53 AM)

```
=INDEX(A:A,MATCH("*",A:A,-1))
```


----------



## Serpher (Sunday at 7:03 AM)

That doesn't really work for me, but I did find this post on this forum Search backward (UP in column) till first non-empty cell
And it works for date values (which are always rising) but not for various decimal values.


MN1HEADER229,8329,84514,56*14,9 [should find this one]*7814,9=LOOKUP(2^1023,$M$2:INDEX($M$2:M13,MATCH(MAX($M$2:M13),$M$2:M13,0)-1),$M$2:M13)

I assume that the problem is with MATCH MAX formula?


----------



## Alex Blakenburg (Sunday at 7:59 AM)

How about

```
= LOOKUP(2, 1/(M:M <> ""), M:M)
```


----------



## Serpher (Sunday at 9:12 AM)

Nah, I tried that already. It only shows previous filled cell, but it could be few empty cells between filled cells. Apparently XLOOKUP would be the best as it has a flag to search backwards, but I'm on 2010.


----------

