GETPIVOTDATA function

%3CLINGO-SUB%20id%3D%22lingo-sub-2781389%22%20slang%3D%22en-US%22%3EGETPIVOTDATA%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2781389%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20WIndows%2010%20and%26nbsp%3B%20Excel%20from%20Office%20365%20for%20small%20business.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20function%20GETPIVOTDATA%20is%20returning%20%23REF%20for%20some%20cells%20of%20a%20pivot%20table%20and%20returning%20the%20right%20value%20for%20others.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20please%20in%20attached%20file.%20The%20problem%20is%20clearly%20shown%20on%20sheet%20%22Resumo%20Provis%C3%A3o%20Malha%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECell%20F22%20to%20F24%20-%20function%20works%20properly%3C%2FP%3E%3CP%3ECell%20F25%20and%20F26%20-%20function%20returns%20%23REF%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2781389%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2781594%22%20slang%3D%22en-US%22%3ERe%3A%20GETPIVOTDATA%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2781594%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1165509%22%20target%3D%22_blank%22%3E%40pauloosorio%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20downloaded%20your%20file%20and%20it%20took%20almost%201%20minute%20just%20to%20open%20it.%3C%2FP%3E%3CP%3EWhen%20verifying%20your%20data%20I%20could%20see%20that%3C%2FP%3E%3CUL%3E%3CLI%3Eyou%20are%20using%20all%20the%20rows%20of%20the%20tab%20%22Dados%20MacWin%22%20as%20range%2C%20it%20its%20unecessary%20and%20also%20it%20is%20terrible%20for%20perfomance%20sake.%3C%2FLI%3E%3CLI%3EMany%20informations%20with%20unnecessary%20blank%20space%2C%20for%20instance%20the%20field%20SArm%20Descricao%20%22%26nbsp%3B%26nbsp%3B%26nbsp%3B%20POSOLIS%20-%20MALHAS%20ACABADAS%20BRAGA%22.%20It%20begins%20with%204%20space%20characters.%20It%20happens%20with%20the%20others%20as%20well.%26nbsp%3B%3C%2FLI%3E%3CLI%3ETry%20to%20standardise%20you%20data%2C%20for%20instance%2C%20your%20formula%20are%20showing%20error%20because%20you%20are%20looking%20for%20the%20%22Armazem%20code%22%3D1390002%2C%20for%20instance%20that%20doesn't%20exist%20in%20your%20data.%20The%20Pivot%20Table%20made%20some%20magic%20tricks%20trying%20to%20standardise%20by%20its%20own%2C%20but%20if%20you%20check%20your%20data%20it%20is%20not%20there.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JulianoPetrukio_0-1632483514743.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312644i3CB8003B414A485E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JulianoPetrukio_0-1632483514743.png%22%20alt%3D%22JulianoPetrukio_0-1632483514743.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20to%20clean-up%20your%20data%20by%20removing%20unnecessary%20spaces%20or%20special%20characters.%20You%20can%20use%20the%20TRIM()%20funciont%20for%20that%20%26gt%3B%26gt%3B%3DTRIM(CLEAN(SUBSTITUTE(J2%2CCHAR(160)%2C%22%20%22)))%3C%2FP%3E%3CP%3EAvoid%20use%20the%20whole%20excel%20range%20as%20data%20set%20for%20your%20pivot%20table.%3C%2FP%3E%3CP%3EUse%20the%20excel%20feature%20called%20Table%2C%20so%20everytime%20your%20range%20increases%20it%20is%20updated%20on%20your%20pivot%20table.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2782082%22%20slang%3D%22en-US%22%3ERe%3A%20GETPIVOTDATA%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2782082%22%20slang%3D%22en-US%22%3EHi%20Juliano%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20very%20much%20for%20your%20help.%20I'm%20going%20to%20follow%20your%20suggestions%20and%20i%20will%20give%20you%20feed%20back.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20very%20much%3CBR%20%2F%3E%3CBR%20%2F%3EB%20regards%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

 

I am using WIndows 10 and  Excel from Office 365 for small business.

 

The function GETPIVOTDATA is returning #REF for some cells of a pivot table and returning the right value for others.

 

See please in attached file. The problem is clearly shown on sheet "Resumo Provisão Malha".

 

Cell F22 to F24 - function works properly

Cell F25 and F26 - function returns #REF

 

Thanks

 

4 Replies

@pauloosorio 

I downloaded your file and it took almost 1 minute just to open it.

When verifying your data I could see that

  • you are using all the rows of the tab "Dados MacWin" as range, it its unecessary and also it is terrible for perfomance sake.
  • Many informations with unnecessary blank space, for instance the field SArm Descricao "    POSOLIS - MALHAS ACABADAS BRAGA". It begins with 4 space characters. It happens with the others as well. 
  • Try to standardise you data, for instance, your formula are showing error because you are looking for the "Armazem code"=1390002, for instance that doesn't exist in your data. The Pivot Table made some magic tricks trying to standardise by its own, but if you check your data it is not there.

JulianoPetrukio_0-1632483514743.png

 

Try to clean-up your data by removing unnecessary spaces or special characters. You can use the TRIM() funciont for that >>=TRIM(CLEAN(SUBSTITUTE(J2,CHAR(160)," ")))

Avoid use the whole excel range as data set for your pivot table.

Use the excel feature called Table, so everytime your range increases it is updated on your pivot table.

Hi Juliano,

Thanks very much for your help. I'm going to follow your suggestions and i will give you feed back.

Thanks very much

B regards

You're welcome.
Dont forget if it helped with your problem to flag it as solved and hit the like button please.
Hi Juliano,

I'm new here. I was checking around but didn´t understand were I flag it as solved. Can help?
Thanks. B regards