Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2007, 11:52 AM
JPC JPC is offline
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formula in Pivot tables

I would like to use the COUNTIF formula using the calculated fields option of the pivot table.
When I use COUNTIF on an excell cell, it works fine but when I use it within the calculated field of pivot table, there is a message error.
To detail a bit more, what I would like to do: i have a excel sheet with a column Vehicle where different Vehicles are listed and on another column totally independant from the first one, a 1 or 0 for presence of cars (not linked to 1st column). The goal is to make a pivot table which shows the number of time appears a car in the first column devided by the sum of values in the car column.
Vehicle car
Car 1
Truck 1
Bike 1
Bike 1
Bike
Truck 1
Truck

Hope somebody could help me on this

 
Old February 20th, 2007, 01:27 PM
Authorized User
 
Join Date: Dec 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Good day budy!

Just read your post and think I have a quick fix to offer. I to use Pivot tables for a lot of my worksheets as a quick ways to manipulate huge sets of data to give me defined results. In your example you are trying to use the countif function directly referencing the fields withen the pivot table. I had this issue at first aswell. I find that the easy way around this is simply to take the data in the fields and mirror them in a couple of phantom columns and then use the funciones there.

So, let use your example:

Vehicle car
Car 1
Truck 1
Bike 1

....lets say "Car" is in A2, in C2 refernce A2 (make sure to type =A2 in C2 and not simply hitting = in C2 and then using the mouse to click the referance cell A2 because that will automatically give you the GETPIVOTDATA Funcion and that will make my work around not work at all)

....So now do the same for all the fields in your pivot table. This will create a mirror image of your Pivot Table next to it and now all you do is apply the formulas to this mirror not the actual fields and hide the mirror columns and voala!

When the fields values change so will your mirror. I know this seems very "simple" fix, but trust me, I was there and tried everything else and quite frankly this simply works and is above all accountable.

Hope it helps Buddy.







Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA for Pivot Tables stealthdevil Excel VBA 3 March 21st, 2007 04:01 PM
how to work pivot tables malli_kv2 Access 1 March 16th, 2007 06:34 AM
Linking pivot tables iacon Excel VBA 3 July 24th, 2006 01:25 AM
International Pivot Tables noldrini Excel VBA 0 February 8th, 2006 12:54 PM
Pivot Tables smartgir Excel VBA 0 May 12th, 2004 10:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.