View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
uslanja uslanja is offline
external usenet poster
 
Posts: 4
Default Pivottable: Show value as a percent of Subtotal

Works just like you said, Ted, and just what I needed.

Very nice formula. Thanks very much.

/Jim

"Ted M H" wrote:

Hi Jim,

Not certain that I understand your question...If you're asking what the
original problem description was, it's at the bottom of this post.

Columns A, B, and C contain the pivot table with fields Region (A) State (B)
and Sales (C). Region and State are both Row area fields and Sales is the
Values area field. Column D is the problem: How to get each State's percent
of its Region sales. For example: Idaho is 90 percent of the North Region's
sales.

By the way, I came up with a nice solution to this problem, building on
others' ideas. Here's the forumla entered in cell D5 and then just copied
down in Column D to the last row of the pivot table in columns A:C.

=C5/INDEX(A5:INDIRECT("C"&COUNTA(C:C)+3),MATCH("*
total",A5:INDIRECT("A"&COUNTA(C:C)+3),0),3)

For this to work you should have the Pivot table arranged in Tabular form
and the first row item should be in row 5 (column headings, page fields, etc.
in rows 1 - 4).
Also, don't override the default Subtotal names since the formula looks for
the literals total to find the subtotal rows. And be sure to put the formula
in col D before you do any filtering in the pivot table. If you make any big
changes to the pivot table, just reenter the formula and copy it down again.

"uslanja" wrote:

Don,

I'm trying to solve the same problem as Ted M H, I think, but not sure what
the "base" pivot table looks like so I can apply your recommended cell
formulas correctly. If either of you recall, would you post something more
descriptive?

Thanks,

Jim

"Don" wrote:

This is a hard one for just pivot tables.

I would do the total by region in one pivot table then for the pivot table
below create two columns
1) =IF(A3="",E2,A3) this will copy down the region from the pivot tables
2) =C3/VLOOKUP(E3,$F$3:$G$4,2) This will look at the number in the sales
column (c3) and divide it by looking at your table from F3:G4 and finding out
the total for that region

F g
North 100
West 200

"Ted M H" wrote:

I need to get my pivot table to return a percent of subtotal instead of a
percent of column. Here's what I want:

Region State Sales Percent of Sales
North Montana 10 10 %
Idaho 90 90 %
North Total 100 100 %
West Calif 50 25 %
Oregon 100 50 %
Arizona 50 25 %
West Total 200 100%

I can easily do this using the Show Value As % of Column option with field
settings for the Sales Field, but as the description implies this gives me
just the percent of of the grand total for the column rather than for the
subtotals.
Is it possible to do what I want here?