View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default CountIf Condition based on lookup in a list of values

Try this:

=SUMPRODUCT(COUNTIF(data,PRIMARY_COLORS))


"Eric E" wrote:

I have a row with input data: cells with values of RED, GREEN, PINK, TAN.
I have a table/range (PRIMARY_COLORS) that includes RED, BLUE, GREEN.
I would like to count the number of valid primary colors are in the input
data row.
I cannot figure out how to include a conditional statement in the COUNTIF
function: i.e., COUNTIF the cell value is a MATCH in the PRIMARY_COLORS range.

Can this be done?

Thanks.