GetPivotDate returns #REF w/o empty quotes at end

sherwole

New Member
Joined
Mar 3, 2012
Messages
1
Hi All,
I am using the same formula to get data from one pivot table:

=GETPIVOTDATA("Sum of No. Reqd",'OCC90 PivT Level 3 Forms'!$A$3,"Sub-System",B234,"Disp.","OVERALL","Week #","")

this is the formula that excel automatically wrote when I clicked on the cell I wanted to read data from in the pivot table. When I copied it down the column, it worked for almost all the cells, however, some returned a reference error. I cannot find a pattern for those that are returning #REF, but if I delete the empty quotes at the end of the reference string so that the formula reads:

=GETPIVOTDATA("Sum of No. Reqd",'OCC90 PivT Level 3 Forms'!$A$3,"Sub-System",B423,"Disp.","OVERALL","Week #",)

the formula returns the correct value. What's the deal?!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi and Welcome to the Board,

The syntax of GETPIVOTDATA is:
GETPIVOTDATA(data_field, pivot_table, [field1, item1], [field2, item2], ...)

So in your first example:
data_field = "Sum of No. Reqd"
pivot_table = 'OCC90 PivT Level 3 Forms'!$A$3 (this is the address of the PivotTable)

[field1, item1] = "Sub-System", B234
[field2, item2] = "Disp.","OVERALL"
[field3, item3] = "Week #", ""

So for the formulas that work without error, there is Visible Item in the PivotTable for the combination of field1,2,3 items.

For the ones that return #REF!, it means there isn't a Visible Item for that combination.

I'm not positive how Excel interprets the formula when the Field parameter is listed but there is no item after the comma as in:
..."Disp.","OVERALL","Week #",)

The fact that this worked for all your formulas makes me think Excel treats this as a wildcard that matches any items in field "Week #".
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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