Counting the occurrence of "Y" & "N" in Excel 2007

C

Christi

I'm just now trying to learn the COUNTIF function but obviously am having a
problem...

If the cell range is (A5:A370) and I need to count the "Y" 's and the "N"
's with the answer resulting in the following format: YYYY/NNNN what would
I use?

Any help apreciated!
 
S

ShaneDevenshire

Hi,

Try this:

=COUNTIF(A5:A370,"Y")&"/"&COUNTIF(A5:A370,"N")

However if your really trying to get the ratio
=COUNTIF(A5:A370,"Y")/COUNTIF(A5:A370,"N")

Might be sufficient. You can force the display of as many digits as you
want by using the custom format code:

# ????/????

In this case it would display up to 4 digits/ 4 digits
 
D

Dave Peterson

=rept("y",countif(a5:a370,"y"))&"/"&rept("n",countif(a5:a370,"n"))

You really want:

yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy/nnnnnnnnnnnnnn

or maybe:

=countif(a5:a370,"y")&"/"&countif(a5:a370,"n")

to see something like:
140/139
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top