View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Calculated field in Pivot Table

You could add a column to the source data, and calculate if a record is
the first group/status item. For example,

=IF(SUMPRODUCT(--($A$2:$A2=A2),--($C$2:$C2=C2))=1,1,0)

Copy the formula to the last row of data.
Add the new field to the data area as a sum

benb wrote:
I have a dataset like the one below (not sure if formatting will come
out right in the posting). The example below is just a simplication of
my actual dataset.
Group Series Status
A A1 Open
A A2 Open
A A3 Unknown
A A9 Closed
A A10 Open
B B1 Closed
B B4 Closed
B B5 Closed
B B6 Closed
C C1 Unknown
D D1 Closed
D D2 Closed
E E1 Open
E E2 Open

What I want to do is count how many Groups fall into the status Open
bucket, how many into Closed, etc. Now because Group A has a Series in
each of the three possible Statuses, it falls into all three buckets.
Group E, on the other hand, only falls into one. If I pull Status into
a Pivot as a Column Field and then do a Count of Group, the values will
actually represent the number of Series in a given Status because the
value A appears in the dataset once for each corresponding Series in
that Group. Have I lost you yet? My hypothesis is that there is a
creative way to use calculated fields in a pivot to get it to show that
there are 2 groups showing Open, 2 showing Unknown, and 3 showing
Closed. I already know I could arrange the pivot in such a way that
=COUNTA( ) in the adjacent cells would give me the same thing, but I'm
looking for a way of doing it in the pivot for reason not worth wasting
any more space on. THANK IN ADVANCE FOR YOUR HELP!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html