I am in the process of creating a spreadsheet for a college golf team that will include a head to head matrix and record every player wins and losses against everyone else. However, I face an issue. Not all players play the same day or on the same course and I want the formula to account for the wins and losses only when 2 players play the same course on the same day. 
You can see on this example that I would need the formula to return, in the matrix, that John would have 1 loss against Mark(row3&4) and that he also has 1 loss against Tom (row 6&7).
In plain English, and in the example of John vs Mark, the formula should: Look for all rows with John and Mark. If date and course are the same, then subtract score to par between John and Mark for each instance. If result is >0, then it is a loss. If result = 0 then, tie. If result < 0 then, win. Then, the formula should add all the wins, losses, and ties and display it in the matrix.
I have been working on finding for a solutions for hours but still have no idea on how to do it. Anyone has any ideas?