我正在寻找一个公式来计算如果A2:A7为“ B”,则从B2:D7出现一种颜色(例如,“红色”)的次数。
。
答案 0 :(得分:0)
=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"))))