ARRAYFORMULA COUNTIF each row separately

前端 未结 2 1754
耶瑟儿~
耶瑟儿~ 2020-12-18 11:55

I try to COUNTIF(B2:Q2;\">5\") for each row and return the result for each row in column A but I clearly fail on using ARRAYFORMULA

相关标签:
2条回答
  • 2020-12-18 12:14

    In addition to Max's solution, I believe it should be possible to use COUNTIF(). See if this works

    =ARRAYFORMULA(COUNTIF(IF(B2:Q>5,ROW(B2:B)), ROW(B2:B)))
    
    0 讨论(0)
  • 2020-12-18 12:16

    Sample File

    =ARRAYFORMULA(MMULT(FILTER(--(B2:Q>5),B2:B<>""),TRANSPOSE(COLUMN(B2:Q)^0)))

    mmult is effective, but slow formula. I used filter to limit the number of calculations.

    Edit. Here's another formula to do the same:

    =ArrayFormula(LEN(SUBSTITUTE(SUBSTITUTE(TRANSPOSE(QUERY(TRANSPOSE(FILTER(--(B2:Q>5),B2:B<>"")),,100500)),"0", "")," ","")))

    Looks clunky but should work faster (not tested).

    0 讨论(0)
提交回复
热议问题