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:
where the coordinates of the two points are given in columns B through E.
The length of a line can be calculated with the distance formula, which looks like this:
Distance is the square root of the change in x squared plus the change in y squared, where two points are given in the form (x1, y1) and (x2, y2). The distance formula is an example of the Pythagorean Theorem applied, where the change in x and the change in y correspond to the two sides of a right triangle, and the hypotenuse is the distance being computed.
In Excel, the distance formula can be written with the exponent operator (^) and the SQRT function like this:
Following Excel's order of operations, the change in x and the change in y is calculated, then squared, and the two results are added together and delivered to the SQRT function, which returns the square root of the sum as a final result:
The Pythagorean theorem is a key principle in Euclidean geometry. It states that the square of the longest side of a right triangle (the hypotenuse) is equal to the sum of the squares of the other two sides. The theorem is written as an equation...
In geometry, the area enclosed by a circle with radius (r) is defined by the following formula: πr 2 The Greek letter π ("pi") represents the ratio of the circumference of a circle to its diameter. In Excel, π is represented in a formula with the PI...
In geometry, the area enclosed by a triangle is defined by this formula: where b represents the base of the triangle, and h represents the height, measured at right angles to the base. In Excel, the same formula can be represented like this: A = b...
In geometry, the circumference of a circle with radius (r) is defined by the following formula: =2πr The Greek letter π ("pi") represents the ratio of the circumference of a circle to its diameter. In Excel, π is represented in a formula with the PI...
The Excel SQRT function returns the square root of a positive number. SQRT returns an error if number is negative.
Excel Formula Training
Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.