Try this "array formula"

=INDEX(A3:A1000,MODE(IF(A3:A1000<>"",MATCH(A3:A1000,A3:A1000,0))))

needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar