If I have a row of cells with values of Y or N in each cell, how can I bring back a value of 1 if ANY Y's exist and a value of 0 if ANY N's exist, without counting the number of Y's and N's?
Thank you
Counting multiple codes as one count



Re: Counting multiple codes as one count
If your cells are in range A1:A10, then to return a 1 if there is at least one "Y" (and nothing if there are no "Y"s, use:
To return zero (or nothing) when testing for "N"s use:
You cannot do it in one formula, of course, because both cases might be true at the same time.

Re: Counting multiple codes as one count
Hi,
=IF(COUNTIF(your range,"Y")>0,1,"")
=IF(COUNTIF(your range,"N")>0,0,"")
HTH

Re: Counting multiple codes as one count
Quote from thomachIf your cells are in range A1:A10, then to return a 1 if there is at least one "Y" (and nothing if there are no "Y"s, use:
To return zero (or nothing) when testing for "N"s use:
You cannot do it in one formula, of course, because both cases might be true at the same time.
That did it! Thank you so much!!

Re: Counting multiple codes as one count
The two responses to my need (Sumproduct and Countif) both worked great! I really appreciated the help. Thank you so much.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!