View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Thomas Dave Thomas is offline
external usenet poster
 
Posts: 146
Default How to count(if) column B IF column A says "x"

Why the double minus when a single minus will do?

"PCLIVE" wrote in message
...
You'll need to specify the actual range (in my example, A1:A15 and
B1:B15).

=SUMPRODUCT(--(A1:A15="x"),--(B1:B15="v2"))

HTH,
Paul

"ONJNo1" wrote in message
...
Column A has 4 variables (w,x,y,z)
Column B has 4 variables (v1,v2,v3,v4)

I am trying to count how many times Column B says "v2" when Column A says
"x". We were previously counting Column B using COUNTIF, but we were not
accounting for Column A. Now, we need to break it down by Column A.

I saw a previous discussion about SUBTOTAL and autofiltering, but my
bosses
are too lazy to filter column A to what they need when they look.. they
would
like it displayed at the bottom all the time...so that wouldn't work
here.

I tried IF, COUNTIF, COUNT and AND. IF came the closest, but I could not
figure out how to get the logical test to accept a range.

Thanks alot... have been trying for 4 hours now...