Hello all,
I have a list of x,y coordinates (for an event) in two columns and need to determine how many of the points that are defined by these coordinates are near (within 50 units) another point (target area). Doing this for a single target area was relatively simple, as I just made another column that calculated the distance using the Pythagorean theorem and put a countif statement at the bottom that looked for distances over 50.
However, I have an 11 x 11 array of target areas and doing 121 additional columns is going to be impractical. I am looking to replace the additional columns with a calculation from a single cell. I attempted to use a convoluted COUNTIF statement that included the Pythagorean theorem in the criteria but it is not working and I don’t know if it will work (from what I’ve read on COUNTIF, it probably won’t).
In the attached data file you will find seven columns and a table of the target values I am trying to calculate. Columns A & B are the x,y coordinates that I have generated, columns C & D reflect the center of the distribution (I will eventually have different distributions with central coordinates). Columns E-G are my basic calculation columns that I am attempting to turn into single cell formulas, with column E corresponding to V12, Column F to L 12, and Column G to V14.
J1:AF22 is the table I am attempting to populate, with the values L2:AF1 being how far the target area is from the center in X, and K2:K22 being how far the target area from the center in y
My current attempt at calculation is the following formula (from L2, which does not work but might help you see my logic:
=COUNTIF($A$2:$B$101,SQRT((($A$2:$A$101-(500+$L4)))^2+(($B$2:$B$101-(400+K$2))^2))<"50")
Thanks!
Bookmarks