Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?