且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用countifs计数多个列

更新时间:2022-12-12 23:19:17

尝试



= SUMPRODUCT((D10:D29 =Q)+(G10:G29 =Q))





= SUMPRODUCT(((D10:D29 =Q)+(G10:G29 = Q)> 0)+0)



如果您在D10和G10中都有Q,则前者将计数2即使有两个Q


,每个行最多只能算一次

I am putting in a formula to count the number of times a quote is required Indicated by the letter Q in a given column, when I put the formula in for one column I get the correct answer, but when I want to do it for multiple columns I get zero, can anyone help please? the formula is

=COUNTIFS(D10:D29,"=Q",G10:G29,"=Q")

Try either

=SUMPRODUCT((D10:D29="Q")+(G10:G29="Q"))

or

=SUMPRODUCT(((D10:D29="Q")+(G10:G29="Q")>0)+0)

the former will count 2 if you have Qs in both D10 and G10 - the latter only counts each row once at most, even if there are two "Q"s