SS:=IF(LNC>REF(LNC,1) AND REF(LNC,1)>=REF(LNC,2),1,IF(LNC<REF(LNC,1) AND REF(LNC,1)<=REF(LNC,2),-1,IF(LNC>REF(LNC,2) AND REF(LNC,2)>REF(LNC,1),2,IF(LNC<REF(LNC,2) AND REF(LNC,2)<REF(LNC,1),-2,0))));
SS1:=IF(LNC>REF(LNC,1) AND REF(LNC,1)>=REF(LNC,2),1,IF(LNC<REF(LNC,1) AND REF(LNC,1)<=REF(LNC,2),-1,IF(LNC>REF(LNC,2) AND REF(LNC,2)>REF(LNC,1),2,IF(LNC<REF(LNC,2) AND REF(LNC,2)<REF(LNC,1),-2,0))));