CountIF (tricky one)

G

Guest

Anybody have any idea how to solve a double countif problem.

eg. Row 1 ---> O B A C O D O
Row 2 ---> D A W M S D D A A

I need to do a count based on the conditions of having an "O" in row#1 and also that "O" observation being an "D" in row#2. In the simpliest case, =countif(row1,"=O") would do the job, but I don't know how to solve the problem when Row2 is introduced. Only idea is to insert another row with a formula serving as a filter.

Anybody have any ideas using formuls or VB code to solve the problem. Many thanks to all!
 
F

Frank Kabel

Hi Gary
if you want to count the occurences that if the cell in row 1 contains
an 'O' and the cell directly below in row 2 contains an "D" try the
following formula
=SUMPODUCT((A1:Z1="O")*(A2:Z2="D"))

HTH
Frank
 
L

Leo Heuser

Gary

Another option:

=SUMPRODUCT((A2:M2&A3:M3="OD")+0)

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

gary said:
Anybody have any idea how to solve a double countif problem.

eg. Row 1 ---> O B A C O D O
Row 2 ---> D A W M S D D A A

I need to do a count based on the conditions of having an "O" in row#1 and
also that "O" observation being an "D" in row#2. In the simpliest case,
=countif(row1,"=O") would do the job, but I don't know how to solve the
problem when Row2 is introduced. Only idea is to insert another row with a
formula serving as a filter.
Anybody have any ideas using formuls or VB code to solve the problem.
Many thanks to all!
 

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

Similar Threads


Top