Cell Reference in GETPIVOTDATA formula is getting deleted

jwar87

New Member
Joined
Jul 21, 2014
Messages
2
Hi, I have really been struggling with this and have no Idea what to do. Here is my formula:

=IF(ISERROR(GETPIVOTDATA("Flavour Trend",UNFIFlavourTrend!$B$3,"Date","Mar")),0,GETPIVOTDATA("Flavour Trend",UNFIFlavourTrend!$B$3,"Date","Mar"))

When I get new information I paste it in the sheet labeled UNFIFlavourTrend, I then run the macro, and out pops a pivot table. This is a formula that I am using to retrieve and summarize information on another sheet from ther pivot table. However, when I paste new data in and run the macro, the cell reference $B$3 turns to #Ref. Is there anyway I can lock this cell reference as $B$3 in the formula?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
jwar87,

What if you name the cell $B$3 (something like "Home") and use the name in your formula:

=IF(ISERROR(GETPIVOTDATA("Flavour Trend",Home,"Date","Mar")),0,GETPIVOTDATA("Flavour Trend",Home,"Date","Mar"))

G/L
 
Upvote 0
jwar87,

What if you name the cell $B$3 (something like "Home") and use the name in your formula:

=IF(ISERROR(GETPIVOTDATA("Flavour Trend",Home,"Date","Mar")),0,GETPIVOTDATA("Flavour Trend",Home,"Date","Mar"))

G/L

Hi,

Thanks for the quick reply! I created the name as you suggested. Now when I input new data and run the macro the name I created stays in the in the Formula like you showed above; however, the reference in the Name changes ie. Referenced cell for name Home changes from SheetName!$B$3 to SheetName!#Ref.

My uneducated hypothesis: The macro is deleting the initial $B$3 cell. Maybe I should use another cell with in the pivot? With my formula $B$3 can be any cell with in the Pivot table.

Hope this make sense!
 
Upvote 0
jwar87,

Interesting. You may be on to something in your hypothesis. If Excel is deleting the cell $B$3, then use the relative cell address. Try this:

=IF(ISERROR(GETPIVOTDATA("Flavour Trend",UNFIFlavourTrend!B3,"Date","Mar")),0,GETPIVOTDATA("Flavour Trend",UNFIFlavourTrend!B3,"Date","Mar"))

G/L
 
Upvote 0

Forum statistics

Threads
1,215,209
Messages
6,123,646
Members
449,111
Latest member
ghennedy

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