welshraz
New Member
- Joined
- Apr 29, 2016
- Messages
- 42
- Office Version
- 365
- Platform
- Windows
Hello hello,
I have these different formulas which pull through a reference number based on the nearest coordinates:-
=IFERROR(LOOKUP(1,1/FREQUENCY(0,MMULT((CombinedNOI[Lat]:CombinedNOI[Long]-U13:V13)^2,{1;1})),CombinedNOI[ORREFERENCEID]),"")
=IF(U13="","",LOOKUP(1,1/FREQUENCY(0,SIN((RADIANS(CombinedNOI[Lat]-U13))/2)^2+SIN((RADIANS(CombinedNOI[Long]-V13))/2)^2*COS(RADIANS(CombinedNOI[Lat]))*COS(RADIANS(U13))),CombinedNOI[ORREFERENCEID]))
=IFERROR(INDEX(CombinedNOI[ORREFERENCEID],MATCH(MIN(SQRT((CombinedNOI[Lat]-U13)^2+(CombinedNOI[Long]-V13)^2)),SQRT((CombinedNOI[Lat]-U13)^2+(CombinedNOI[Long]-V13)^2),0),1),"")
They work really well, but is there any way of amending them so that they pull through the second and third closest?
I have these different formulas which pull through a reference number based on the nearest coordinates:-
=IFERROR(LOOKUP(1,1/FREQUENCY(0,MMULT((CombinedNOI[Lat]:CombinedNOI[Long]-U13:V13)^2,{1;1})),CombinedNOI[ORREFERENCEID]),"")
=IF(U13="","",LOOKUP(1,1/FREQUENCY(0,SIN((RADIANS(CombinedNOI[Lat]-U13))/2)^2+SIN((RADIANS(CombinedNOI[Long]-V13))/2)^2*COS(RADIANS(CombinedNOI[Lat]))*COS(RADIANS(U13))),CombinedNOI[ORREFERENCEID]))
=IFERROR(INDEX(CombinedNOI[ORREFERENCEID],MATCH(MIN(SQRT((CombinedNOI[Lat]-U13)^2+(CombinedNOI[Long]-V13)^2)),SQRT((CombinedNOI[Lat]-U13)^2+(CombinedNOI[Long]-V13)^2),0),1),"")
They work really well, but is there any way of amending them so that they pull through the second and third closest?