Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sheets: How to get the last non-zero and non-empty value in a column?

Say Column A has the following values in 7 rows:

2
[blank]
0
-0.3
0
[blank]
0

How can I get the last value in the range (7 rows) which is not empty/blank, and not zero? Therefore in this case, the correct answer would be -0.3.

like image 661
Shian Han Avatar asked Oct 22 '25 06:10

Shian Han


1 Answers

=INDEX(A:A, MAX(FILTER(ROW(A:A),NOT(ISBLANK(A:A)),A:A>0)), 0)

Ripped off of this answer:
https://productforums.google.com/forum/#!topic/docs/kgDmjZ-zhMY

like image 79
Eric Avatar answered Oct 25 '25 21:10

Eric



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!