I have a table below and want to compute a sum of products of a value of an element multiplied by a square of a distance to that element.

For example, for F(1) it would be sum( SUMSQ(A1-A(i),B1-B(i)) * c(i))

I've tried tried sum and sumproduct but couldn't figure out how to build a formula How to do it in excel?

`23/Max(sqrt((1-1)^2+(2-2)^2),1) + (-29)/Max(sqrt((1-3)^2+(2-3)^2),1) +34/Max(sqrt((1-8)^2+(2-7)^2),1) +42/Max(sqrt((1-9)^2+(2-9)^2),1)+ ..`