ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Average function for letters (https://www.excelbanter.com/new-users-excel/437402-average-function-letters.html)

ZWarren

Average function for letters
 
I am trying to compute a percentage for a range of A4:A24; the only values in the cells are either an "X" or it is left blank.

If possible, I am trying to compute the percentage of the whole A4:A24 range where the "X"s will count as a yes and the blank field will count as a no, adding up all the X's (yes's) and counting them against the blank fields (no's) to get an percentage of how many X's there are compared to blanks

Can anyone help please, Ive searched tutorials but im not sure this is possible

Thanks EB

joeu2004[_2_]

Average function for letters
 
"ZWarren" wrote:
I am trying to compute the percentage of the whole
A4:A24 range where the "X"s will count as a yes
and the blank field will count as a no, adding up
all the X's (yes's) and counting them against the
blank fields (no's) to get an percentage of how
many X's there are compared to blanks


AVERAGE is the wrong function to use for this purpose. Try:

=COUNTIF(A4:A24,"X")/ROWS(A4:A24)

formatted as Percentage.

Of course, you could replace ROWS(A4:A24) with 21.

Spencer101

Quote:

Originally Posted by ZWarren (Post 1566668)
I am trying to compute a percentage for a range of A4:A24; the only values in the cells are either an "X" or it is left blank.

If possible, I am trying to compute the percentage of the whole A4:A24 range where the "X"s will count as a yes and the blank field will count as a no, adding up all the X's (yes's) and counting them against the blank fields (no's) to get an percentage of how many X's there are compared to blanks

Can anyone help please, Ive searched tutorials but im not sure this is possible

Thanks EB

Quick and dirty, but it works :)

=COUNTA(A4:A24)/SUM(COUNTA(A4:A24)+COUNTBLANK(A4:A24))

Format the cell as %.

ZWarren

Quote:

Originally Posted by Spencer101 (Post 1568500)
Quick and dirty, but it works :)

=COUNTA(A4:A24)/SUM(COUNTA(A4:A24)+COUNTBLANK(A4:A24))

Format the cell as %.

This worked, I appreciate it!


All times are GMT +1. The time now is 09:40 PM.

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