CountIF (tricky one)

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
 
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!
 
Back
Top