countif ?

D

dmack

How would i count the number of times that two items are listed together in
the same row in a string of cells say b2 to g12.

"sell" and "stock" are togeter in rows D, E and F. Say - "Sell" is D3 and
"stock" is D11, "sell" is E5 and "stock" is E7, "sell" is F2 and "stock" is
F8. What fomula could i use that would give me an answer of 3?
 
D

dmack

Roger, sorry i meant listed in the same column not row and you only included
"sell" not sell and stock. Looks like a difficult solution to this one.
Appreciate your assistance
 
C

Crane

This worked on my test, but didnt have time to really beat it up. you would
need to add more countifs for all columns

=IF(AND(COUNTIF(D:D,"sell")>0,COUNTIF(D:D,"stock")>0),1,0)+IF(AND(COUNTIF(D:D,"sell")>0,COUNTIF(E:E,"stock")>0),1,0)+IF(AND(COUNTIF(E:E,"sell")>0,COUNTIF(E:E,"stock")>0),1,0)
 
Top