suppose i have A1:A5 like so:
| |
| 12 |
| |
| 14 |
| |
i'm using this formula to get the first non zero occurence:
=INDEX(A1:A5, MATCH(TRUE,INDEX(A1:A5<>0),0))
, which:
INDEX(A1:A5<>0)
returns a column like 'FALSE TRUE FALSE TRUE FALSE'MATCH(TRUE,previousPart,0)
returns 2 meaning that the second row is the the first one to match exactly TRUE
INDEX(A1:A5,previousPart)
returns the val from row 2but i would like to get the last non zero occurence. in this case, 14
. what is the shortest and/or simplest way to achieve this?
Try:
=CHOOSEROWS(FILTER(A1:A5, 0 <> A1:A5), -1)