Creating a GETPIVOTDATA formula that retrieves dyanmic "items" (as in the syntax [field, item] as defined by a cell reference

Need_help_in

New Member
Joined
Jul 22, 2014
Messages
8
Hi All,

I am attempting to create a GETPIVOTDATA formula that retrieves dynamic "items" (as in the syntax [field, item] as defined by a cell reference.

I have written the following formula:

=GETPIVOTDATA("CS Hours", [reference to pivot table in another workbook], "Field Name 1",A2, "Field Name 2", [today's date], "Field Name 3", C2)

What I would like for the result to be is that the GETPIVOTDATA will obtain the value of the "CS Hours" field where "Field Name 1" equals the value of cell A2, "Field Name 2" equals the value of today's date, and "Field Name 3" equals the value of Cell C2.

I would like to define cell reference A2 and C2 as the value of those cells, while referencing them in the [field, item] syntax. The "Field Name 1" field will be defined by the text "Field Name 1", and thus will not need to be dynamic as this is how the field is identified within the pivot table used to look up the value. I attempted to use the INDIRECT function to perform this, but it was to no avail.

Now I question whether the GETPIVOTDATA function is even the correct function to use in this instance. Any assistance would be sincerely appreciated.

Thank you so much for your time and assistance.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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