I'm looking for the formula to count how many times appears a color, for example, "red", from B2:D7 if A2:A7 is "B".
.
=COUNTA(IFERROR(QUERY(A2:D,
"select A
where A = 'B'
and (B = 'RED'
or C = 'RED'
or D = 'RED')", 0)))
=ARRAYFORMULA(COUNTA(IFERROR(QUERY(TRANSPOSE(TRIM(QUERY(TRANSPOSE(FILTER(
IF(B2:D="RED", 1, ), A2:A="B")),,999^99))), "where Col1 is not null", 0))))
=ARRAYFORMULA(COUNT(IFERROR(FILTER(
IF(B2:D="RED", 1, ), A2:A="B"))))