By the way - you check that O and P are different. Does it mean you can have two points with exactly the same pair of coordinates? if not, shorter version will be quicker:
{=INDEX($N$2:$N$1000,MATCH(MIN(IF(Q2<>Q$2:Q$1000,ABS(O2-O$2:O$1000)+ABS(P2-P$2:P$1000))),IF(Q2<>Q$2:Q$1000,ABS(O2-O$2:O$1000)+ABS(P2-P$2:P$1000)),0))}
And I am not sure about application, but in most of them, cartesian distance would be more appropriate than using
ABS(O2-O$2:O$1000)+ABS(P2-P$2:P$1000)
so:
(O2-O$2:O$1000)^2+(P2-P$2:P$1000)^2
(as you do not calculate distance, but only locate smallest one, no need for SQRT here).