I have an excel spreadsheet with a column with states where I have ran races. I would like to write a function that returns the last out of state race I ran. How would I do that?
Asked
Active
Viewed 101 times
0
-
Use Lookup? Something along the lines of `=LOOKUP(2,1/(A:A<>"State"),A:A)` – JvdV Aug 22 '20 at 17:47
1 Answers
1
You can use INDEX()
to get the
row number:
=INDEX(MAX((A:A<>"")*(A:A<>"NJ")*(ROW(A:A))),0)
and INDEX()
to get the value:
=INDEX(A:A,INDEX(MAX(($A:$A<>"")*(A:A<>"NJ")*(ROW(A:A))),0))
for the last value not equal to NJ.

Gary's Student
- 95,722
- 10
- 59
- 99
-
Thanks @Gary's Student! That worked! Now I am trying to get the corresponding date ad I am using index match to do so. When I do that, it shows the first time I ran in the state, not the last time. Any idea why? – Denis McElligott Aug 22 '20 at 20:24