View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default How can I do this?

=SUMPRODUCT(--(A1:A7=1),--(B1:B7=2))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Rachel" wrote in message
...
Hello. Here's the scenario:

I have a list of numbers in Colum A, and a list in Colunm B.
A B
1 2
1 1
2 1
3 1
4 2
1 2
3 1

I want to count the number of cells in Column B with a certain value (say
'2'), but only if the adjacent cell in column A contains a certain value

(say
'1'). Can anyone help?

Thanks a million,
Rachel.