View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default How do I set up a formula to add column a if column b = cell c1?

Hi

Add a column to your source table in column D, called Count.
Enter the following formula in D2 and copy down
=IF(SUMPRODUCT(($B$2:B2=B2)*($A$2:A2=A2))1,"",SUM PRODUCT(($B$2:B2=B2)*($A$2:A2=A2)))
Add Sum of Count to your PT Data area

--
Regards
Roger Govier

"NS" wrote in message
...
I a question that is somewhat similar: Assuming I have the following data:

CITY USERID Month
ATL JDOE JAN
ATL PSAM JAN
ATL JDOE JAN
JFK JTIK JAN
JFK SBOX JAN
JFK JTIK JAN
JFK JPIG FEB
JFK JDOG FEB
ATL JCOW FEB
ATL JCAT FEB
ATL JCOW FEB

What formula or series of formulas can I use to answer the question "How
many PEOPLE were in JFK & ATL in Jan and Feb??" I tried using Pivot tables
but PIVOT tables count each individual row as one record, so it shows 3
records in the month of JAN as opposed to the 2 PEOPLE that were in ATL in
JAN. How do I get around the fact that there are duplicate records? Thank
you