How to use ARRAYFORMULA to count the nb of word for every row

℡╲_俬逩灬. 提交于 2021-02-10 17:48:05

问题


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.

Screen of spreadsheet


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!