问题
I'm using google form and after submitting data, I want to count (number of word "OUI" ) for every row.
I tried the function: =ArrayFormula(COUNTIF(B$3:D3;"*OUI*"))
but it works only for the first row.
回答1:
In addition to the solution provided by player0, another way would be to use countif...
=ArrayFormula(if(len(A3:A),COUNTIF(if(B3:D="OUI", ROW(A3:A)),ROW(A3:A)),))
回答2:
=ARRAYFORMULA(IF(LEN(A3:A),
MMULT(IFERROR(LEN(B3:D)/LEN(B3:D), 0), TRANSPOSE(COLUMN(B3:D3)^0)), ))
=ARRAYFORMULA(IF(LEN(A3:A),
MMULT(IFERROR(LEN(REGEXEXTRACT(REGEXREPLACE(B3:D, "OUI", "♦"), "♦"))/
LEN(REGEXEXTRACT(REGEXREPLACE(B3:D, "OUI", "♦"), "♦")), 0),
TRANSPOSE(COLUMN(B3:D3)^0)), ))
来源:https://stackoverflow.com/questions/56237150/how-to-use-arrayformula-to-count-the-nb-of-word-for-every-row