Tom’s Tutorials For Excel: First and Last Values Along a Row
When you are faced with a table that is scattered with values among empty cells, you might need to know the first (left-most) or last (right-most) value in that row.
In the following picture, the first value in the row is returned by the formula
=INDEX(D2:H2,MATCH(TRUE,INDEX((D2:H2<>0),0),0)), copied down as needed.
In the next picture, the last value in the row is returned by the formula
=INDEX(2:2,MATCH(9.99999E+307,2:2)), copied down as needed.