I wonder if anyone can help. I'm trying to calculate the rank correlation coefficient for some exercises I've got to do. However, I'm struggling.

In the material we have been given it says that that you calculate the difference between the data, so for example person A (4) and person B (5) gives a difference of 1, however this is only for two people and the data I have got to do it for has more than one person.

It is test results as below:

Candidate A B C D E

Test X 2 3 5 6 9
Test Y 3 5 9 11 17

Test L 2 2 4 5 7
Test M 8 7 6 5 4

How to I calculate the difference? It's probably something very simple!