GETPIVOTDATA Formula

southcali12

New Member
Joined
Sep 22, 2015
Messages
28
Hi,

I am trying to use the GETPIVOTDATA formula to fill in the table below:
Date
12/7/2015
12/8/2015
12/9/2015
12/10/2015
12/11/2015
Sales

<tbody>
</tbody>

My pivot table looks like such:
Date
Sales
12/7/2015
300
12/8/2015
120
12/9/2015
150
12/10/2015
500

<tbody>
</tbody>

The formula I have written is:
=GETPIVOTDATA("Sales",$A$3,"Date",H1)
So for example $A$3 is where the Date is located in the pivot table and H1 is the date.

Any advice would be greatly appreciated. Thank you!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi,

From the little info give, your formula looks OK. Could you explain what your issue is...does your formula return an error or ...
 
Upvote 0
I'm not sure what else could be wrong. The pivot table is in tabular form, I don't know if that would matter? Or that the Sales is in the value field.
 
Upvote 0
What formula is generated if you type = and then select the cell you want in the pivot table?
 
Upvote 0
If the formula would return no result, the error would be #VALUE. This #REF error is probably caused by an fault in the formula. My guess would be to check the format of the date in cell H1 and ensure it has same format as within your data.
 
Upvote 0
Hi thank you for your response the formula that is generated is:
=GETPIVOTDATA("[Measures].[Sales]",$B$3,"[RawData].[Date]","[RawData].[Date].&[2015-11-23T00:00:00]")

OH. I see the problem now! And please correct me if I'm wrong, but as I added my data into the Powerpivot, the date got converted to be yyyy-mm-ddThh:mm:ss (even though I reformatted it to be m-dd-yyyy). So if I want to change the date in the formula above, I would have to add in the =TEXT formula to the =GETPIVOTDATA formula?
 
Upvote 0
You'll need something like:

=GETPIVOTDATA("[Measures].[Sales]",$B$3,"[RawData].[Date]","[RawData].[Date].&["&TEXT(H1,"yyyy-mm-dd")&"T00:00:00]")
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,957
Members
449,200
Latest member
indiansth

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