ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count designated cells (https://www.excelbanter.com/excel-worksheet-functions/38367-count-designated-cells.html)

VB

Count designated cells
 
I want to count designated cells (versus a range) only if they meet a certain
criteria:

Count cells A1, C1, E1 and F1 if they contain the word "yes"

A1=No Answer
B1=Yes
C1=Yes
D1=Yes
E1=No Answer
F1=No

In the above example the answer would be 1; cells B1 and D1 are not counted
because they are not designated in the formula, where they would be counted
if a range were used.

Biff

Hi!

Try one of these:

=SUM((A1="yes"),(C1="yes"),(E1="yes"),(F1="yes"))

=SUMPRODUCT(--(MOD(COLUMN(A1:F1),2)=1),--(A1:F1="yes"))+(F1="yes")

Biff

"VB" wrote in message
...
I want to count designated cells (versus a range) only if they meet a
certain
criteria:

Count cells A1, C1, E1 and F1 if they contain the word "yes"

A1=No Answer
B1=Yes
C1=Yes
D1=Yes
E1=No Answer
F1=No

In the above example the answer would be 1; cells B1 and D1 are not
counted
because they are not designated in the formula, where they would be
counted
if a range were used.





All times are GMT +1. The time now is 08:26 AM.

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