View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default What formula would I use?

On Sun, 27 Sep 2009 18:22:01 -0700, Redland
wrote:

What formula would I use to find the total distance between two points on an
x,y scatter chart containing both positive and negative numbers? For example
if one point is (-100,0) and another point is (100, 0) then the distance
would be 200 or 201 if you count zero. My data would be as follows:

Column B Column C
-9 -78
-326 -110
-130 50
-52 -318
146 91
160 150
-22 -90
348 222
-30 170
342 342
-394 -396
114 -37

I am not a proficient programmer for VB, but am always willing to try if
that is what it takes. Thanks for the help.



I think it is just the equation for the hypotenuse of a right-angled triangle.

=sqrt((x1-x2)^2+(y1-y2)^2)

Your example is a special case where one dimension is zero, and in that case
you can just subtract one from the other. But your points may have different
x's and y's.
--ron