GetPivotData Function

T

Takeadoe

=GETPIVOTDATA("PrehuntTotal",'pvt prehunt ASMtotal'!$A$3,"COUNTY",$AF
$2)

Those familiar with the GetPivotData function know that "pvt prehunt
ASMtotal" is the name of the pivot table and "PrehuntTotal" is the
variable name - the data I'm interested in. The value for "County" is
set dynamically. The user selects county from a drop down list. The
choice is placed in Cell $AF$2. My question for the group is this -
would there be a way to set the variable name the same way that the
value of county is set so that the user can select the variable of
interest on the fly?

Very best,

Mike
 
B

Bernie Deitrick

Mike,

AFAIK, not from within the GetPivotData function - the datafield can only be passed as a string, not
as a cell that contains the correct string, unfortunately.

You could set up one GetPivotData for each data field, and then use a VLOOKUP or MATCH function to
pull the desired value from the set of GetPivotData functions...

HTH,
Bernie
MS Excel MVP
 
D

Debra Dalgleish

With the variable name in cell A2, concatenate an empty string to the
cell reference:

=GETPIVOTDATA(A2&"",'pvt prehunt ASMtotal'!$A$3,"COUNTY",$AF$2)
 
T

Takeadoe

With the variable name in cell A2, concatenate an empty string to the
cell reference:

=GETPIVOTDATA(A2&"",'pvt prehunt ASMtotal'!$A$3,"COUNTY",$AF$2)

Thank you Debra!
 
T

Takeadoe

Mike,

AFAIK, not from within the GetPivotData function - the datafield can only be passed as a string, not
as a cell that contains the correct string, unfortunately.

You could set up one GetPivotData for each data field, and then use a VLOOKUP or MATCH function to
pull the desired value from the set of GetPivotData functions...

HTH,
Bernie
MS Excel MVP









- Show quoted text -

Hey Bernie - Did you happen to see Debra's post? What does AFAIK
stand for? Thanks for taking time to reply.

Mike
 
B

Bernie Deitrick

Mike,

AFAIK = As Far As I Know....

And, yes, I saw Debra's post, who happens to be clearly better with Pivot Tables than 100% of the
rest of the world....

Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top