excel 2003 - GETPIVOTDATA

silentbuddha

Board Regular
Joined
Mar 1, 2008
Messages
112
Hi,

I am having difficulty trying to create a cell reference within my GETPIVOTDATA formula

example :
GETPIVOTDATA("Sum of "&$C$16,ASIAN!$DD$10,"Week",DATE(D$8,D$7,D$6))

How do I create a cell reference for : ASIAN!$DD$10 ??

Thanks in advance :)
 
Hi JunaPa

Unfortunately...that MS KB article did not resolve the problem...when I point to the pivot table, the GETPIVOTDATA formula is already generated

this is an example of what the formula generates:

GETPIVOTDATA("Sum of "&$C$16,ASIAN!$DD$10,"Week",DATE(D$8,D$7,D$6))

However, I am still unable to create a reference for this portion of the GETPIVOTDATA formula : ASIAN!$DD$10

I have tried entereing the worksheet name in cell A1 ( A1 = ASIAN ) and the changing the formula ( see below ) but I still get a #ref error

GETPIVOTDATA(......,"'" & $A$1 & "'!"&$DD$10,..........)

Thanks !
 
Upvote 0
Use INDIRECT and a reference to whichever cell contains the relevant cell address.
 
Upvote 0
Hi Rorya,

This is what excel tells me about the formula

GETPIVOTDATA(data_field, pivot_table, [Field 1], [Item 1]......)

What i have so far :

GETPIVOTDATA("Sum of "&$C$16,ASIAN!$DD$10,"Week",DATE(D$8,D$7,D$6))


I am certain that ASIAN!$DD$10 represents the worksheet pivot table that I am pointing to, however, new worksheets can be created anytime and I dont want the user to change ASIAN!$DD$10 to EUROPE!$DD$10

In Cell A17 i typed in ASIAN
In Cell A18 i typed in EUROPE

afterwards, I tried the below formula and still not luck....

GETPIVOTDATA("Sum of " & $C$16,INDIRECT("A17"&"!"&$DD$10),"Week",DATE(D$8,D$7,D$6))

Thanks for your patience :)
 
Upvote 0
It would be:
GETPIVOTDATA("Sum of " & $C$16,INDIRECT("'"&A17&"'!$DD$10"),"Week",DATE(D$8,D$7,D$6))
 
Upvote 0
silentbuddha

GETPIVOTTABLE has always been a wee bit difficult to work with, and sometimes the problem is as simple as an errant space, a misspelt word etc.

Have you tried removing the 'Sum of' part?

By the way unless you actually want to use other cells to create a reference to the pivot table you shouldn't need INDIRECT.

All you should need is a normal reference to a cell withing the pivot table, which is usuallly what Excel gives you automatically.

By the way what is in C16?
 
Upvote 0
Hi Norie & Rorya,

thank you both for being so patient...I went back to basics and did some simple exercises with the INDIRECT function to get a better grip on this particular function ... and I have found the solution ( which was staring at me the whole time )

here is my solution to make a dynamic reference to the pivot table locate on another worksheet within the same workbook.

=GETPIVOTDATA("Sum of " & $C$16,INDIRECT(A17&"!$DD$10"),"Week",DATE(D$8,D$7,D$6))

PS...Norie : in C16 is the pivot field items which i placed in the pivot data area. Basically, my pivot table layout has the all the weeks for current year in the pivot table column section. Every other pivot field item is placed in the pivot table data area.

Thanks once again :)
 
Upvote 0
Hi Norie & Rorya,

thank you both for being so patient...I went back to basics and did some simple exercises with the INDIRECT function to get a better grip on this particular function ... and I have found the solution ( which was staring at me the whole time )

here is my solution to make a dynamic reference to the pivot table locate on another worksheet within the same workbook.

=GETPIVOTDATA("Sum of " & $C$16,INDIRECT(A17&"!$DD$10"),"Week",DATE(D$8,D$7,D$6))

A17 : is the worksheet name to which the pivot table is located
$DD$10 : i assume this is the pivot table location

PS...Norie : in C16 is the pivot field items which i placed in the pivot data area. Basically, my pivot table layout has the all the weeks for current year in the pivot table column section. Every other pivot field item is placed in the pivot table data area.

Thanks once again :)
 
Upvote 0
Safer to include the single quotes, as I did, in case your worksheet name has spaces in it.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top