copy a GETPIVOTDATA formula ?

liveinhope

Well-known Member
Joined
Dec 16, 2013
Messages
857
With "normal" formulas when you copy the formula down to rows below the relative cell adresses change to refer to the data on the other rows.

But With GETPIVOTDATA copy down copies like absolute cell addresses (my pivot table and GETPIVOTDATA formula below)
In the end I entered (by pointing ) the formula seperately each of the row values "North","South" "East" "West"

Not too bad in this instance as there were only 4 different row values but if there were a large number that would be a real pain !

Is there a way round this ?
formula
=GETPIVOTDATA("AVG SHIPD",$F$1,"br","east")/GETPIVOTDATA("AVG ORDER",$F$1,"br","east")



<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>

Values
Row LabelsSum of orderedSum of shippedAVG ORDERAVG SHIPD
east1254041.666666666666713.3333333333333
north1705556.666666666666718.3333333333333
south70553527.5
west50352517.5
Grand Total41518541.518.5

<COLGROUP><COL style="WIDTH: 84pt; mso-width-source: userset; mso-width-alt: 2048" width=112><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 1865" width=102><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 1609" width=88><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 1865" width=102><COL style="WIDTH: 96pt; mso-width-source: userset; mso-width-alt: 2340" width=128><TBODY>
</TBODY>
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Yes, you can use relative references in GetPivotData arguments.

For your example, if the cell displaying "east" is F3, then your formula could be:

=GETPIVOTDATA("AVG SHIPD",$F$1,"br",$F3")/GETPIVOTDATA("AVG ORDER",$F$1,"br",$F3)

This could be copied down to reference $F4 (north), $F5 (south)...
 
Upvote 0
beautiful ! as I said point-and-enter for each line isnt too bad in this example but would drive me mad if I had to do it

for something like a Pivot table with 50 US states!
thank you
 
Upvote 0
I understand how to make the modifications to the formula posted by liveinhope. My GetPivot formula looks completely different and I can't figure out how to modify it. The "FW" is Fiscal Week. I want to copy the formula down for all 52 weeks of the year. I have tried a lot of variations but can't get it to work. How do I modify my formula to copy it down?
Code:
GETPIVOTDATA("[Measures].[TotalHours]",$N$7,"tbl_calendar_labor].[FW]","[tbl_calendar_labor].[FW].&[1.]")/CODE]
 
Upvote 0
The structured field references in brackets indicate you probably have an OLAP data source.

Assuming that you have the value "1" in A1, "2" in A2 and so on, try this syntax...

=GETPIVOTDATA("[Measures].[TotalHours]",$N$7,"[tbl_calendar_labor].[FW]","[tbl_calendar_labor].[FW].&["& A$1 &".]")
 
Upvote 0

Forum statistics

Threads
1,215,764
Messages
6,126,750
Members
449,335
Latest member
Tanne

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