Sheet1 & Sheet 2

I am looking for a way that can perform the following task in excel for each of the column A values:
- Match value
A2of sheet 1 to the right value in arrayA2:C2from Sheet2 and return the respective array beneath the matching column (in this caseA3:A4from Sheet2). - This array would then need to be used for a
COUNTIFfunction for finding valueB2within this returning array.
Sheet1 (Results)