|
楼主 |
发表于 2013-3-18 01:51
|
显示全部楼层
谢谢楼上,达到了我的目的,但是我在使用经纬计算代替原来的求绝对值就有问题了。
我先描述下计算2个点之间距离的公式,假设X点经纬度分别额为B2、C2,Y点经纬度分别为F2、G2
则XY距离为(6378137*2*ASIN(SQRT(SUMSQ(SIN((RADIANS(C2) - RADIANS(G2))/2))+ COS(RADIANS(C2))*COS( RADIANS(G2))*SUMSQ(SIN((RADIANS(B2)-RADIANS(F2))/2)))))
根据你提供的公式={INDEX($A:$A,SMALL(IF(ABS($B$2:$B$31-$D2)<$E2,ROW($B$2:$B$31),4^8),COLUMN(A1)))&""
}
我把修改成了I2={INDEX($A:$A,SMALL(IF((6378137*2*ASIN(SQRT(SUMSQ(SIN((RADIANS($C$2:$C$400) - RADIANS($G2))/2))+ COS(RADIANS($C$2:$C$400))*COS( RADIANS($G2))*SUMSQ(SIN((RADIANS($B$2:$B$400)-RADIANS($F2))/2)))))<$H2,ROW($B$2:$B$400),4^8),COLUMN(A1)))&""}
就出错了
|
|