Change Pivot Data Source Based on Cell Selection

elbarauljr

New Member
Joined
May 4, 2020
Messages
19
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello,

Workbook name: Report
Sheet with pivot: Summary
Sheets with data source: Source1 , Source2 (data in range A1:C14)

In the above workbook, I defined the name PivotChange_Source with formula =INDIRECT(Summary!$A$1&"!A1:C14") to change the Pivot source within the Workbook based on A1 input to select the correct source and then refresh the pivot. All working ok, attached picture for this situation.

The problem is that I need to change the Pivot source coming from other workbook named "Source" that is in directory U:\ , this workbook have the same source sheets Source1 , Source2 and same source range A1:C14
I tried input in cell A1 U:\[Source.xlsx]Source1, but refreshing the pivot is shows error "Reference isn't valid"

What would be the correct input in cell A1 or formula change in the Name Manager to properly refresh the pivot coming from the workbook named "Source" ?

Thanks in advance.
 

Attachments

  • Pivot Source.jpg
    Pivot Source.jpg
    110 KB · Views: 104

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
are you using your 2007 version or the 365 version of excel?
if you are using the 2007 version, you may need to enter that formula with Cntl-Shft-Enter, as per this MS article:

if you are using 365, then the above article is moot.
 
Upvote 0
Using 365, tried to modify the formula per the article but still getting the "Reference isn't valid" when refreshing the pivot table. Attached picture is showing the issue.

Not sure if the issue is the formula in the Name Manager or the dropdown source list U:\[Source.xlsx]Source1

Pivot refresh is only working when selecting source that are within the same workbook, but not from the external workbook. Any idea what is not working ?
 

Attachments

  • Report File Workbook.jpg
    Report File Workbook.jpg
    193.1 KB · Views: 41
Upvote 0
Using 365, tried to modify the formula per the article but still getting the "Reference isn't valid" when refreshing the pivot table. Attached picture is showing the issue.

Not sure if the issue is the formula in the Name Manager or the dropdown source list U:\[Source.xlsx]Source1

Pivot refresh is only working when selecting source that are within the same workbook, but not from the external workbook. Any idea what is not working ?
when you look at Name Manager do you see the U:\[Source.xlsx]Source1 cell reference address? this is getting beyond my expertise.
 
Upvote 0
here is a screenshot of the Name Manager. the Pivot refresh when selecting a source within the workbook, but not when selecting the source U:\[Source.xlsx]Source1
 

Attachments

  • Name Manager.jpg
    Name Manager.jpg
    38.9 KB · Views: 31
Upvote 0
what happens when you only have this value in cell in your name manager formula?

Excel Formula:
=INDIRECT(Summary!$A$1)
 
Upvote 0
what happens when you only have this value in cell in your name manager formula?

Excel Formula:
=INDIRECT(Summary!$A$1)
The formula =INDIRECT(Summary!$A$1) in the name manager only works for sources within the same workbook "Report", for example when input in cell A1 is Source1!$A$1:$C$14, but still have the same "Reference isn't valid" issue to refresh pivot when source is coming from external workbook "Source" when input in A1 [Source.xlsx]Source1!$A$1:$C$14 or U:\[Source.xlsx]Source1!$A$1:$C$14 .It looks like indirect formulas in the name manager only works when the source is within the same workbook "Report".

Attached picture shows both Indirect formulas for the Name Manager and respective inputs for A1 in green that does not work to change the pivot source located in the workbook "Source".
 

Attachments

  • 1.jpg
    1.jpg
    143.7 KB · Views: 36
Upvote 0
then don't use the range name from the other workbook. Can you try to put the entire path (including cell reference) in the calculation?

but maybe it is not possible for pivot reports. Do you need a pivot report? Can you create a data range using array calculations?
 
Upvote 0
Yes, I tried the entire path. I will explore with Power Query connections. Thank you for your help.
 
Upvote 0

Forum statistics

Threads
1,224,726
Messages
6,180,574
Members
452,988
Latest member
wcself81

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