Counting cells

A

Adel Handal

Hi,
I had this before, but it didn't work weel! I may have not made it clear.

Range C5:C29 containes either letter C or letter M.
Range D5:D29 containes either letter M or letter F

line 5 C F
line 6 C M
line 7 M M
...........
In cell D34 I want to count the number of occurance of the combination of C
and M.
The array formula =COUNTIF(C5:C29,"C")
counts the value of colomn C.
What adjustment do I need to do to include the values in colomn D?
I tried this: =COUNTIF(C5:C29,"C"), (D5:D29,"M")
but had an error

Khalil
 
B

Biff

Try one of these:

=COUNTIF(C5:D29,"C")+COUNTIF(C5:D29,"M")

=SUM(COUNTIF(C5:D29,{"C,"M"}))

Biff
 
A

Adel Handal

Hi,
Non of the worked!
They are arrya formulas.
The firsr one counted all the M's and C's in both colomns.
To be more clear I might refrase it as follows:
need to count the number of rows that has C and M in the same line in
colomns C and colomn D
 
B

bobocat

=sumproduct((c5:c29="c")*(d5:d29="m"))

Adel Handal said:
Hi,
Non of the worked!
They are arrya formulas.
The firsr one counted all the M's and C's in both colomns.
To be more clear I might refrase it as follows:
need to count the number of rows that has C and M in the same line in
colomns C and colomn D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top