for example, case of 5 number.(1..5)
1. Let Cells[A2 to A6] and Cells[B1 to F1] be these numbers.
2. type the formula "=ABS($A2-B$1) " in the cell[B2]. Drag the formula until Cell[F6] and you will get all |Xi-Xj| in the matrix.
1 2 3 4 5
1 0 1 2 3 4
2 1 0 1 2 3
3 2 1 0 1 2
4 3 2 1 0 1
5 4 3 2 1 0
3.Do the same thing for getting PiPj.
4.Use the formula "=sumproduct(matrix1,matrix2)" to get the result.



雷达卡


京公网安备 11010802022788号







