PDA

View Full Version : [SOLVED:] Vlookup or similiar within a GETPIVOTDATA Statment



Scuba
07-30-2024, 05:24 AM
Hello,

I have a list of vendor names that I wish to reference within a GETPIVOTDATA statment so that I can auto populate the correct value per vendor name i.e. the corresponding quantity is pulled from the pivot table that matches the same vendor name.




I tried removing the actual name and referencing the actual cell but this returns a #ref error:



=GETPIVOTDATA("Qty Shipped",PIVOT!$B$5,"Vendor","GIZA SPINNING WEAVING CO","Month Name","Feb","Year","2024")


changed to



=GETPIVOTDATA("Qty Shipped",PIVOT!$B$5,"Vendor",$B14,"Month Name","Feb","Year","2024")


also tried



=GETPIVOTDATA("Qty Shipped",PIVOT!$B$5,"Vendor","$B14","Month Name","Feb","Year","2024")


Both fail


The end goal here is if I add any new names to the list, they are auto populated with correct data, when I drag the formula down (after refreshing the pivot table data of course)


Any help would be greatly appreciated.

Regards

Paul_Hossler
07-30-2024, 02:23 PM
Post a small sample of data in a workbook and indicate just what data you want ro extract

Scuba
07-31-2024, 01:24 AM
Thank you Paul, for your quick response, I thought I had mark the thread as solved as I solved the issue myself yesterday.

It was a school boy error, sometimes you can't see the wood for the tree's as the saying goes, the field I was referencing had a space in front of the vendor name and so didn't match VLOOKUP value, hence the value, once I removed the space, all was good.

Once I change the formula to the below, after removing the spaces from field B14, all was good, no more error and I could copy down the formula.

Thank you.



=GETPIVOTDATA("Qty Shipped",PIVOT!$B$5,"Vendor",$B14,"Month Name","Feb","Year","2024")