I am using COUNTIF
to count the number of occurrences of a value in a horizontal range, which is working fine:
Now I would like to use ARRAYFORMULA
to automatically apply that logic to an entire column. My problem is that ARRAYFORMULA
doesn't seem to work well with COUNTIF
as my range spans both horizontally and vertically. I tried several things:
=ARRAYFORMULA(IF(COUNTIF(B2:D,"Passed")=3,"Passed","Failed"))
: the formula doesn't even replicate across the column=ARRAYFORMULA(IF(ISBLANK(B2:B),"",IF(COUNTIF(B2:D,"Passed")=3,"Passed","Failed")))
: using the extraIF(ISBLANK(B2:B)
trick solves the above issue, but the results are wrong
How can I apply ARRAYFORMULA
to a formula containing a horizontal COUNTIF
?
Here is a link to the spreadsheet if you want to play around
=if(countif(V2:X2,"■") = 1,Acorn1,if(countif(V2:X2,"■") = 2,Acorn2,if(countif(V2:X2,"■") = 3,Acorn3,"")))
. What arrayformula should I use to expand vertically? – Riccardo