Help with GetPivotData formula

pujo

Well-known Member
Joined
Feb 19, 2009
Messages
710
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Made my first PivotTable.
I want to get data from the PivotTable into a cell on another sheet.
Using the GETPIVOTDATA function, I can retrieve data however...

This returns exactly what the formula says.
Excel Formula:
=(GETPIVOTDATA(" Products",ProductionPivot!$B$2,"Months",4,"Years",2023))

I want to retrieve data based on current month and year. (MONTH(TODAY()), YEAR(TODAY()) if possible.
How do I accomplish this?

Thanks!
 
Okay, I now have a better understanding.
If I create the formula in the same sheet as the pivot table, I get the results I am looking for.
Creating the formula on a different sheet with date cell references on that different sheet, I get the errors.

Thanks for your time and patience!

Pujo
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Thanks for the update and glad we could help.

PS: The formula should work with the pivot on a different sheet though.

Below is what my resulting formula looked like with the Pivot on sheet "ProductionPivot"

Cell Formulas
RangeFormula
G2G2=MONTH(TODAY())
G3G3=YEAR(TODAY())
G5G5=GETPIVOTDATA("Products",ProductionPivot!$B$2,"Months",$G$2,"Years",$G$3)
H5:H7H5=FORMULATEXT(G5)
G6G6=GETPIVOTDATA("Products",ProductionPivot!$B$2,"Months",MONTH(TODAY()),"Years",YEAR(TODAY()))
G7G7=IFERROR(GETPIVOTDATA("Products",ProductionPivot!$B$2,"Months",$G$2,"Years",$G$3),"")
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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