It's quite easy with COUNTIFS - put this in B5:

=COUNTIFS(Sheet1!$B:$B,$A$2,Sheet1!C:C,$A5)

Copy into D5 and F5, then copy down as required.

Hope this helps.

Pete