Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

Excel GetPivotData Function

Copper Contributor

I have a worksheet report that represents production activity in weekly periods (two columns per week). All columns are working correctly up until week 40 and after week 40, where one specific cell is not populating.


That cell contains a series of formulas (added together to get total from 10 different pivot tables). 


=IFERROR(GETPIVOTDATA("Sum of Reject",'[Daily Machine Tally 2019.xlsm]Pivot Data'!$AQ$3,"WK",CG$3),0)+IFERROR(GETPIVOTDATA("Sum of Reject",'[Daily Machine Tally 2019.xlsm]Pivot Data'!$AT$3,"WK",CG$3),0)+IFERROR(GETPIVOTDATA("Sum of Reject",'[Daily Machine Tally 2019.xlsm]Pivot Data'!$AW$3,"WK",CG$3),0)......


All 10 of the individual GetPivotData functions in week 40 column return a #REF error. The data is displayed in the source pivot table (in another workbook). All other rows/columns (weeks) are reporting correctly before and after week 40, only a single cell in week 40 is not responding.

I have tried to copy/paste the formula from other cells that are working to the week 40 offending cell with no results. If I reference another "WK" (i.e. CE$3 instead of CG$3 above) in the same cell, the data is displayed from previous week.

Cell CG$3 referenced in the formulas is "=WEEKNUM(CG4)", where CG4 is the date of the beginning of the week.

Not sure what is missing or incorrect.


2 Replies



The GetPivotData creates an absolute reference and many Excel users prefer to turn of this functionality bygoing to:

  • File Tab
  • Select Options
  • Select Formulas
  • Uncheck the box for GetPivotData
  • Hit OK


Get Pivot.png


Hope That Helps

Nabil Mourad

@Hwqi67  Figured out that when the month changes in the middle of the week, that week is in the previous month as well as the next month - two data references to the same week confuses GetPivotData. I separated the month data from the weekly data to solve the problem.

Thanks for any assistance.