Formula argument based on text

  • Thread starter Thread starter gregork
  • Start date Start date
G

gregork

Hi All,
I have cells (A1:A10) populated with text ("Pass" or "Fail").
In cell (A11) I want to have a formula that returns the text: "pass" if all
the cells (A1:A10) contain the text "pass"
"fail" if any one of the cells (A1:A10) contains the text "fail".
How would I write the formula to achieve this?

Regards
gregork
 
One way

Put in A11:
=IF(COUNTIF(A1:A10,"Pass")=10,"Pass",IF(COUNTIF(A1:A10,"Fail")>0,"Fail","---
--"))

The expression caters for the possibility that
the range A1:A10 might either not be fully populated
or if there might be text other than "Pass" or "Fail" in the range:
["-----" will be returned if so]
 
One way

=IF(COUNTIF($A$1:$A$10,"Pass")=10,"Pass","Fail")

if they can be empty you can use

=IF(COUNTBLANK(A1:A10)=10,"",IF(COUNTIF($A$1:$A$10,"Pass")=10,"Pass","Fail")
)

I am assuming here that if there are not 10 Pass then there must be at least
one fail or 10 blanks
 
Back
Top