Google-sheets – Formula that displays the last non-zero value cell

formulasgoogle sheets

I have a report that is able to pull/display values based on yesterday's values.

Is there a way I can modify the formula to ignore cells that contain zeros "0s" and to continue to reference/pull the LAST cell that contains a numeric value?

Current formula:

=INDEX(SM!40:40,COUNTA(SM!A40:AG40))

Screenshot:

Best Answer

You can find the last numeric value in row 1 (excluding 0s, blanks and text) with:

=index(filter(1:1,1:1<>0),count(filter(1:1,1:1<>0)))

INDEX
FILTER
COUNT