Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / October 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christi - 14 Oct 2008 03:05 GMT
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!
Signature

~Christi

Max - 14 Oct 2008 03:16 GMT
=REPT("Y",COUNTIF(A5:A370,"Y"))&"/"&REPT("N",COUNTIF(A5:A370,"N"))
Signature

Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:61
xdemechanik
---

> I'm just now trying to learn the COUNTIF function but obviously am having a
> problem...
[quoted text clipped - 4 lines]
>
> Any help apreciated!
ShaneDevenshire - 14 Oct 2008 03:17 GMT
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
Signature

Thanks,
Shane Devenshire

> I'm just now trying to learn the COUNTIF function but obviously am having a
> problem...
[quoted text clipped - 4 lines]
>
> Any help apreciated!
Dave Peterson - 14 Oct 2008 03:17 GMT
=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

> I'm just now trying to learn the COUNTIF function but obviously am having a
> problem...
[quoted text clipped - 6 lines]
> --
> ~Christi

Signature

Dave Peterson

Christi - 14 Oct 2008 03:39 GMT
Thanks fella's!  I knew this was my best chance. :0)
Signature

~Christi

> =rept("y",countif(a5:a370,"y"))&"/"&rept("n",countif(a5:a370,"n"))
>
[quoted text clipped - 19 lines]
> > --
> > ~Christi
Max - 14 Oct 2008 08:24 GMT
Aha, I focused on this part in your orig. post, wrongly it seems:
> .. with the answer resulting in the following format:  YYYY/NNNN
Signature

Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:61
xdemechanik
---

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.