In Excel 2010 I have a worksheet that uses data from monthly Pivot Tables in different externel Excel files (cumulating sales per month) using GetPivotData and I want to use the INDIRECT command to adress variabel filenames changing monthly to a higher number (1 to 12). The problem is in getting data from subtotals in the Pivot Table.
When I get the data directly from the Pivot Table there is no problem and I get the correct data, by using the following command (in fact I use a Dutch version but I translated these to the English equivalents):
=GetPivotData("Sum of Deposits";'C:\Data\User\Group\Company\2014\Invoicehistory\[Invoicing 2014-10.xlsx]PivotTable'!$A$3;"Month";2)
"Month" is the columnlabel and the number 2 stands for monthnumber 2 (e.g. February)
When I try to get the same data by using the INDIRECT command there is a problem because of the quotation marks that are needed to define te columnlabel "month". With the INDIRECT command Quotation marks are used for building the text string to define the path.
Therefore the command:
=GetPivotData("Sum of Deposits";INDIRECT("'C:\Data\User\Group\Company\2014\Invoicehistory\[Invoicing 2014-"&TEXT(CurrentWorksheet!$B$2;"00")&".xlsx]PivotTable'!$A$3;"month";2"))
is not possible.
I have tried to trick Excel bij typing "month" in cell B12 and referring to that cell using the CHOOSE command and also using the CONCATENATE command, but that was no succes.
Can you help me with this problem?