SQRT returns an error ifnumberis negative.
Distance formula
To compute the length of a 2D line given the coordinates of two points on the line, you can use the distance formula, adapted for Excel's formula syntax. In the example shown, the formula in G5, copied down, is: =SQRT((D5-B5)^2+(E5-C5)^2) where the coordinates of the two points are given in columns B through E.