SOLVED

GET PIVOTDATA #REF! error

%3CLINGO-SUB%20id%3D%22lingo-sub-959125%22%20slang%3D%22en-US%22%3EGET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959125%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20frustrated!%26nbsp%3B%20I%20have%20posted%20this%20question%202%20times%2C%20but%20it%20never%20appears%20in%20my%20conversations%20on%20the%20community.%26nbsp%3B%20Trying%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20use%20the%20GET%20PIVOTDATA%20function%20to%20reference%20data%20from%20within%20a%20Pivotable.%26nbsp%3B%20When%20I%20enter%3A%26nbsp%3B%3CFONT%3E%3DGETPIVOTDATA(%22Amount%22%2C'2019'!%24R%244%2C%22Fund%22%2C%221100%22%2C%22Orgn%22%2C%222002%22%2C%22Acct%22%2C%225815%22)%3C%2FFONT%3E%2C%20I%20get%20the%20result%20of%20%2415%2C589.15%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20the%20function%20to%20be%20dynamic%20and%20retrieve%20the%20information%20displayed%20in%20the%20Acct%20field%20stored%20in%20cell%20T8%20in%20the%20Pivot%20Table.%26nbsp%3B%20When%20I%20change%20the%20function%20to%26nbsp%3B%3CFONT%3E%3DGETPIVOTDATA(%22Amount%22%2C'2019'!%24R%244%2C%22Fund%22%2C%221100%22%2C%22Orgn%22%2C%222002%22%2C%22Acct%22%2CT8)%3C%2FFONT%3E%20I%20get%20%23REF!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20am%20I%20doing%20wrong%3F%26nbsp%3B%20How%20do%20I%20fix%20this%20to%20keep%20it%20dynamic%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20your%20help%2C%3C%2FP%3E%3CP%3ETom%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-959125%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959394%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959394%22%20slang%3D%22en-US%22%3EDepends%20on%20what's%20in%20T8.%20If%20that%20value%20isn't%20in%20the%20pivottable%20%23REF!%20is%20the%20result.%20Please%20note%20that%20you%20might%20need%20to%20convert%20the%20contant%20of%20T8%20to%20text%3A%3CBR%20%2F%3E%3DGETPIVOTDATA(%22Amount%22%2C'2019'!%24R%244%2C%22Fund%22%2C%221100%22%2C%22Orgn%22%2C%222002%22%2C%22Acct%22%2CT8%26amp%3B%22%22)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959403%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959403%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F341469%22%20target%3D%22_blank%22%3E%40Tom_at_work%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20believe%20it%20doesn't%20like%20the%20explicit%20reference%20calling%20out%20to%20T8%20directly.%26nbsp%3B%20After%20you%20changed%20the%20formula%20did%20you%20change%20the%20pivot%20arrangement%20or%20toggle%20the%20filter%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20may%20want%20to%20arrive%20at%20T8%20without%20referencing%20it%20directly.%26nbsp%3B%20INDIRECT%20or%20OFFSET%20is%20worth%20a%20try.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959418%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959418%22%20slang%3D%22en-US%22%3EDirect%20reference%20to%20a%20cell%20normally%20works%2C%20but%20the%20cell%20must%20contain%20something%20that%20is%20in%20the%20relevant%20part%20of%20the%20pivottable.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959604%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959604%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F22322%22%20target%3D%22_blank%22%3E%40Jan%20Karel%20Pieterse%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20Jan%20for%20your%20quick%20response.%26nbsp%3B%20Converting%20to%20text%2C%20based%20on%20your%20syntax%20worked%2C%20but%20please%20educated%20me%20on%20%22how%22%20this%20works.%26nbsp%3B%20I%20understand%20the%20concatenate%20function%20with%20the%20%26amp%3B%20symbol%2C%20but%20I%20don't%20understand%20how%20the%20syntax%20for%20this%20statement%20works.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20worked!%26nbsp%3B%20Look%20forward%20to%20your%20response.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959621%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959621%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F428790%22%20target%3D%22_blank%22%3E%40Patrick2788%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20Patrick.%26nbsp%3B%20Didn't%20change%20the%20Pivot%20Table%2C%20but%20using%20the%20argument%20T8%26amp%3B%22%22%20did%20the%20trick.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959620%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959620%22%20slang%3D%22en-US%22%3EAdding%20an%20empty%20string%20to%20a%20number%20converts%20that%20number%20to%20a%20string%20value.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959636%22%20slang%3D%22en-US%22%3ERe%3A%20GET%20PIVOTDATA%20%23REF!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959636%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F22322%22%20target%3D%22_blank%22%3E%40Jan%20Karel%20Pieterse%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGood%20to%20know!%26nbsp%3B%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I am frustrated!  I have posted this question 2 times, but it never appears in my conversations on the community.  Trying again.

 

I want to use the GET PIVOTDATA function to reference data from within a Pivotable.  When I enter: =GETPIVOTDATA("Amount",'2019'!$R$4,"Fund","1100","Orgn","2002","Acct","5815"), I get the result of $15,589.15

 

I want the function to be dynamic and retrieve the information displayed in the Acct field stored in cell T8 in the Pivot Table.  When I change the function to =GETPIVOTDATA("Amount",'2019'!$R$4,"Fund","1100","Orgn","2002","Acct",T8) I get #REF!

 

What am I doing wrong?  How do I fix this to keep it dynamic?

 

Thank you in advance for your help,

Tom

 

8 Replies
best response confirmed by Tom_at_work (Occasional Contributor)
Solution

Depends on what's in T8. If that value isn't in the pivottable #REF! is the result. Please note that you might need to convert the content of T8 to text:
=GETPIVOTDATA("Amount",'2019'!$R$4,"Fund","1100","Orgn","2002","Acct",T8&"")

@Tom_at_work 

I believe it doesn't like the explicit reference calling out to T8 directly.  After you changed the formula did you change the pivot arrangement or toggle the filter?

 

You may want to arrive at T8 without referencing it directly.  INDIRECT or OFFSET is worth a try.

Direct reference to a cell normally works, but the cell must contain something that is in the relevant part of the pivottable.

@Jan Karel Pieterse 

Thanks Jan for your quick response.  Converting to text, based on your syntax worked, but please educated me on "how" this works.  I understand the concatenate function with the & symbol, but I don't understand how the syntax for this statement works.

 

This worked!  Look forward to your response.

@Patrick2788 

Thanks Patrick.  Didn't change the Pivot Table, but using the argument T8&"" did the trick. 

 

Thanks,

Adding an empty string to a number converts that number to a string value.

@Jan Karel Pieterse 

Good to know!  Thanks!

Hi Jan, I have a similar question except instead of returning a text value, I need to return a blank field from the pivot table as a number. The pivot table contains information about sales by each salesperson. Since some of the salespeople are new, there is blank (null?) data in some of the months and when I try to reference the sum of that particular month in my calculation, it returns an #REF! error. The formula is =GETPIVOTDATA("Total Ext. Price",$A$3,"SO Month",1). I've made sure the pivot table number format is a number.