ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calculating Percentages in a Range (https://www.excelbanter.com/excel-worksheet-functions/21525-calculating-percentages-range.html)

Allen7575

Calculating Percentages in a Range
 
How do I set up an Excel formula that calculates the percentage of "Y"
entries in a range of cells that contains both "Y" and "N" entries?

Ron Coderre

When I filled in Cells A1:C10 with various X's and Y's, this forumula worked:

=COUNTIF($A$1:$C$10,"Y")/COUNTIF($A$1:$C$10,"*")

It divides the number or cells containing Y by the number of cells
containing anything (but not blank).

If the range may include blanks that you want counted, try this:
=COUNTIF($A$1:$C$10,"Y")/(ROWS($A$1:$C$10)*COLUMNS($A$1:$C$10))

Note: In either case, you need to set the number format to Percent.

Does that help?

Regards,
Ron


All times are GMT +1. The time now is 12:17 AM.

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