# Counting number of times two adjacent cells match a certain criteria

Hello, I’m looking for a way to count the number of times two adjacent cells in two separate columns match. In this example, column A contains vehicle types (“SUV”, “Sedan”, “Truck”), and in column B contains vehicle color (“Red”, “Blue”, “Black”).

I want to count the number of black SUVs:

``````       A        B
1    SUV      Red
2    Truck    Blue
3    Sedan    Red
4    SUV      Black
5    Sedan    Blue
6    Truck    Blue
7    SUV      Black
``````

In this case, the function should print 2.

Is there a way to do this?

``````      A                B                     C
1   KIND_ON	    COLOUR_ON	   2
2   suv       	    black	       =SUMPRODUCT(UPPER(A2)=UPPER(A7:A13);
UPPER(B2)=UPPER(B7:B13))
...
6   KIND	        COLOUR
7   SUV	        Red
8   Truck	        Blue
9   Sedan	        Red
10  SUV	        Black
11  Sedan	        Blue
12  Truck	        Blue
13  SUV	        Black``````

Thank you, this worked! I would upvote you, but I don’t have enough points