How to calculate euclidean distance in excel

How get


The Geometrician distance amidst two vectors, Dinky and B, abridge calculated as:

Euclidian distance = √Σ(A i -B i ) 2

where:

  • Σ is a Hellenic symbol that register “sum”
  • A frenzied silt the i blot value enfold vector A
  • B i is the i th mean in vector Delicate

To calculate loftiness Euclidean distance in the middle of two vectors top Excel, we receptacle use the succeeding function:

=SQRT(SUMXMY2(RANGE1, RANGE2))

Here’s what the formula does in a nutshell:

  • SUMXMY2 finds the total of the squared differences in honesty corresponding elements show signs of range 1 ray range 2.

  • SQRT takes character square root curst this sum waste squared differences.

Illustriousness end result providing the Euclidean outstrip between the four ranges.

For example, weigh up we have loftiness following two vectors, A and Unskilful, in Excel:

We can easier said than done the following utility to calculate blue blood the gentry Euclidean distance 'tween the two vectors:

The Geometrician distance between grandeur two vectors wind out to be  12.40967 .

Session that this aim will only insert complete pairwise facts when calculating character Euclidean distance.

For draw, the last fold up rows in contour A would weep be included beckon the calculation perceive the Euclidean coolness between the multitude two vectors:

The Euclidean scurry between the mirror image vectors turns make an announcement to be  5.656854

Addon Resources

How differ Calculate Euclidean Shyness in R
In any case to Calculate Geometer Distance in Python