ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   I want to be able to input "Y" or "N" and tally them as 1 or 0. (https://www.excelbanter.com/excel-worksheet-functions/133629-i-want-able-input-y-n-tally-them-1-0-a.html)

lia

I want to be able to input "Y" or "N" and tally them as 1 or 0.
 
Out of 30 possible entries, I can have either y, n or blank. I want to
equate the sum of the "Y" and divide by the total number of y+n (not blank)
entries. Any ideas?

Elkar

I want to be able to input "Y" or "N" and tally them as 1 or 0.
 
To count the "Y"'s use this formula:

=COUNTIF(A1:A30,"Y")

To count the nonblanks:

=COUNTA(A1:A30)

And, to combine the two:

=COUNTIF(A1:A30,"Y")/COUNTA(A1:A30)

HTH,
Elkar


"lia" wrote:

Out of 30 possible entries, I can have either y, n or blank. I want to
equate the sum of the "Y" and divide by the total number of y+n (not blank)
entries. Any ideas?


Bob Phillips

I want to be able to input "Y" or "N" and tally them as 1 or 0.
 
=COUNTIF(A:A,"Y")/SUM(COUNTIF(A:A,{"Y","N"}))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"lia" wrote in message
...
Out of 30 possible entries, I can have either y, n or blank. I want to
equate the sum of the "Y" and divide by the total number of y+n (not
blank)
entries. Any ideas?




John

I want to be able to input "Y" or "N" and tally them as 1 or 0.
 
if your data is in cells a1:a30 try =COUNTIF(A1:A30,"y")/COUNTA(A1:A30)
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"lia" wrote:

Out of 30 possible entries, I can have either y, n or blank. I want to
equate the sum of the "Y" and divide by the total number of y+n (not blank)
entries. Any ideas?


lia

I want to be able to input "Y" or "N" and tally them as 1 or 0
 
Thanks, I was trying to use SUMIF, but it was too clunky. This is elegant.

"Elkar" wrote:

To count the "Y"'s use this formula:

=COUNTIF(A1:A30,"Y")

To count the nonblanks:

=COUNTA(A1:A30)

And, to combine the two:

=COUNTIF(A1:A30,"Y")/COUNTA(A1:A30)

HTH,
Elkar


"lia" wrote:

Out of 30 possible entries, I can have either y, n or blank. I want to
equate the sum of the "Y" and divide by the total number of y+n (not blank)
entries. Any ideas?



All times are GMT +1. The time now is 05:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com