Example (lease counting).xlsx

I need to count the number of cells that contain a certain value if another cell contains certain data.

I first need to see if cells in a column contain certain data (the data is in a range)
If a cell contains that data, then I need to see if another cell in that row equals a value (again in range). Then I need a count on how many cells have that value.

Pretty sure this isn't a great explanation...please see the attached example.

(the example is on limited data....my real life spreadsheet contains 18,000 rows)

Thanks in advance for your help!!!