There were actually 2 things i needed:
The first was simply to calculate the average rating given to every cd.
The second was to calculate a users average rating.
Step 1 Then for user 1, cd 1, take the average rating from the rating given to cd1.
Step 2 Do this for user2 as well.
Step 3 Then mulitply these 2 values together.
This will give total1
Repeat step1, only this time square the result
Repeat step2, only this time square the result
Step 4 - Get the square root of this value
This will give total2
Divide total1 by total2
Do this for every cd that both users have rated and add all the values together