0

I have a set of columns that look like this:

Keep Label
red            
blue           
green          
Yellow         
Pink

I want to do a COUNTIFS function that does a count if the row is "red", "green" or "yellow.

Expected Output: 3

Any suggestions? This is what I am using:

COUNTIFS(A:A,"red","green","yellow)

Edit #1:

My Original Question was Solved, but just out of curiosity, let's say I have something like this:

Color     person
Red       Steve
Blue      Sally
Red       Dave
Green     James
Yellow    Dave

I want to count the number of records in the 1st column, where the second column equals "Dave", so my expected outcome is 1.

What I tried doing was something like this:

=SUM(COUNTIFS(A2:A5,"Red",B2:B5,"Dave")), but this is not working. Any suggestions?

1 Answers1

1

Escel-2007 and Excel-365

=SUM(COUNTIFS(A:A,{"red","blue","yellow"}))

COUNTIFS will create an array identifying matches, which SUM adds to get total.