Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Adding a calculated field to a pivot table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DanL - 08 Mar 2008 20:43 GMT
I have a pivot table that includes these fields:
1. A count of "Traffic types" (which are text)
2. A count of "Sales Dollars" (which is in currency)

I want to add a calculated field that will take #2 above and divide it by #1.

When I create such a field (= 'Sale '/ 'Traffic Type') I get a divide by
zero error, even though fields are populated. I am trying to get to a
"closing %". Can anyone advise me as to where I am making my error?
Thanks!
Dan
Sean Timmons - 08 Mar 2008 20:56 GMT
Unfortunately, calculated fields caculate off the original table, not the
pivot table.

An alternate option is to calculate outside the table. So, assuming you have
your headers in A3 through C3, and each subject takes up to rows, Try going
to D5 and typing C5/C4. Highlight D4 to D5, copy, paste down  to the bottom.

> I have a pivot table that includes these fields:
> 1. A count of "Traffic types" (which are text)
[quoted text clipped - 7 lines]
> Thanks!
> Dan
DanL - 09 Mar 2008 15:07 GMT
Sean:
Thanks for the response, I appreciate it!! When I go to the source table
(not the pivot table, correct?) to add the formula you suggest, that would
now attempt to divide a number by text, would it not? When I did that, it
still returns a 'name' error.

Did I read your instruction correctly?

> Unfortunately, calculated fields caculate off the original table, not the
> pivot table.
[quoted text clipped - 14 lines]
> > Thanks!
> > Dan
Debra Dalgleish - 09 Mar 2008 19:11 GMT
The calculated fields always use the Sum of the pivot fields, even if
you're using another summary function, such as Count. For text fields,
the sum will always be zero, so that's why the calculation isn't working
the way you want it to.

In your source table, you can add two columns -- one to count the
traffic types (TraffCount), and one to count the sales dollars
(SaleCount). You could manually enter a 1 in each column, or use a
formula to calculate the count.

For example, if the Sales Dollars are entered in column G:
  =IF(G2=0,0,1)
Do the same for Traffic Types, or if there will always be a Traffic Type
 entered, just type a 1 in the Traffic Count column.

Then, in the pivot table, create a calculated field with the formula:
  =SaleCount/TraffCount
and format it as percentage.

> I have a pivot table that includes these fields:
> 1. A count of "Traffic types" (which are text)
[quoted text clipped - 7 lines]
> Thanks!
> Dan

Signature

Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

DanL - 09 Mar 2008 21:22 GMT
Debra:
That did it and thank you for the great tip!! I have about an hour into this
trying all kinds of formulas and convoluted thinking and your simple solution
did the trick.
Appreciatively,
Dan

> The calculated fields always use the Sum of the pivot fields, even if
> you're using another summary function, such as Count. For text fields,
[quoted text clipped - 26 lines]
> > Thanks!
> > Dan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.