Hello,
I've gotten good at nesting formulas to the point that I need to start using UDF's.
Function Dist(XA As Double, YA As Double, XB As Double, YB As Double)
Dist = Sqr((YA - YB) ^ 2 + (XA - XB) ^ 2)
End Function
I think the function would be improved by using
Function Dist(PT1 As Range, PT2 As Range)
PT1 would contain an X,Y coordinate with PT2 containing a second. The UDF would make this monster much easier to manage.
=IF(BV15="","",IF(IF(SQRT(POWER(AL$21-BT15,2)+POWER(AK$21-BS15,2))<SQRT(POWER(AL$21-(BP15),2)+POWER(AK$21-BO15,2)),AL$22,AK$22)=AL$22,IF(SQRT((POWER((BL15-BP15),2)+POWER(BK15-BO15,2)))<SQRT(POWER(BL15-BR15,2)+POWER((BK15-BQ15),2)),BU15,BS15),IF(SQRT(POWER(BL15-BV15,2)+POWER(BK15-BU15,2))<SQRT(POWER(BL15-BT15,2)+POWER(BK15-BS15,2)),BO15,BQ15)))
Best Regards,
Jay