Sorry to bump a 3 year old thread, however this gives me exactly what I need however when I try to expand the number of "Wells" being matched from 151 to 766 I return #N/A values. How would edit this code to look up against all 766 wells?
Code:
=INDEX(Well!C:C,MATCH(MIN(ACOS(SIN(RADIANS(B7))*SIN(RADIANS(Well!A$2:Well!A$151))+COS(RADIANS(B7))*COS(RADIANS(Well!A$2:Well!A$151))*COS(RADIANS(C7-Well!B$2:Well!B$151)))),ACOS(SIN(RADIANS(B7))*SIN(RADIANS(Well!A$2:Well!A$151))+COS(RADIANS(B7))*COS(RADIANS(Well!A$2:Well!A$151))*COS(RADIANS(C7-Well!B$2:Well!B$151))),0)+1,0)
All help is greatly appreciated
Regards