+1 for using the right tool..
however try
(the following is an array formula and needs to be entered Holding control shift enter) when you look at the formula it will have {} at each end
=INDEX($C$1:$C$17,MATCH(SMALL(((($D$1:$D$17)-A1)^2+(($E$1:$E$17)-B1)^2)^0.5,1),((($D$1:$D$17)-A1)^2+(($E$1:$E$17)-B1)^2)^0.5,0))
where
A1 – B17 is the track lat and long
C1 – C17 is the waypoint ref
D1 – E17 is the way point lat and long