Look up Name and count how many are X or Y

New Contributor

I have a table with Carriers and another column with Trailer Code (either shipping or receiving).


What would be a good formula for counting how many shipping trailers there would be for a specific carrier? vise versa with receiving trailers 


I was exploring with COUNTIF and VLOOKUP but I wasn't able to get anything figured out well and kept getting NA back. 



3 Replies
What is your Excel version? Do you have Microsoft-365?
best response confirmed by CaitlynEXCEL (New Contributor)

@CaitlynEXCEL The attached workbook contains four examples of possible answers to your question. If your Excel version supports dynamic array functions, you could use FILTER. Otherwise COUNTIFS or SUMPRODUCT. Or, why not use a Pivot Table?

@CaitlynEXCEL Try COUNTIF() in this way