Getting the last non-empty cell in a row

AnchovyLegend picture AnchovyLegend · Jul 6, 2013 · Viewed 72.2k times · Source

I am having a lot of difficulty trying to come up with a way to 'parse' and 'order' my excel spreadsheet. What I essentially need to do is get the last non empty cell from every row and cut / paste it a new column.

I was wondering if there is an easy way to do this?

I appreciate any advice. Many thanks in advance!

Answer

barry houdini picture barry houdini · Jul 6, 2013

Are your values numeric or text (or possibly both)?

For numbers get last value with this formula in Z2

=LOOKUP(9.99E+307,A2:Y2)

or for text....

=LOOKUP("zzz",A2:Y2)

or for either...

=LOOKUP(2,1/(A2:Y2<>""),A2:Y2)

all the formulas work whether you have blanks in the data or not......