Automatically insert rows on worksheet linked to Pivot Table

%3CLINGO-SUB%20id%3D%22lingo-sub-1815399%22%20slang%3D%22en-US%22%3EAutomatically%20insert%20rows%20on%20worksheet%20linked%20to%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815399%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20using%20Excel%20in%20Office%20365.%20I%20have%20a%20worksheet%20linked%20to%20a%20Pivot%20Table%20in%20the%20same%20workbook.%20The%20worksheet%20is%20linked%20via%20cell%20references%20on%20the%20pivot%20table%20table.%20Here's%20the%20problem%3A%20Whenever%20new%20rows%20of%20data%20are%20added%20to%20the%20pivot%20table%2C%20the%20worksheet%20does%20not%20automatically%20update%20with%20these%20new%20rows.%20I%20have%20to%20go%20to%20the%20worksheet%20and%20manually%20drag%20down%20the%20formulas%20so%20they%20reference%20the%20new%20pivot%20table%20rows.%20This%20happens%20in%20reverse%20when%20rows%20are%20deleted%20from%20the%20pivot%20table.%20I%20have%20to%20manually%20delete%20rows%20on%20the%20worksheet%20so%20they%20match%20the%20pivot%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%201)%20The%20pivot%20table%20contains%2010%20rows%20and%20the%20linked%20spreadsheet%20shows%20those%2010%20rows.%202)%20The%20pivot%20table%20is%20refreshed%20and%20now%20has%2020%20rows%2C%20but%20the%20linked%20spreadsheet%20still%20only%20shows%2010%20linked%20rows.%203)Then%20I%20have%20to%20go%20to%20the%20worksheet%20and%20manually%20change%20the%20cell%20references%20to%20include%20the%2010%20new%20rows%20from%20the%20pivot%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20have%20my%20data%20on%20the%20linked%20worksheet%20automatically%20adjust%20for%20changes%20in%20the%20number%20of%20rows%20on%20the%20Pivot%20table%3F%20Thanks%20for%20your%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1815399%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1815460%22%20slang%3D%22en-US%22%3ERe%3A%20Automatically%20insert%20rows%20on%20worksheet%20linked%20to%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815460%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F844691%22%20target%3D%22_blank%22%3E%40Gregger%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20Office%20365%20then%20it%20is%20possible%20to%20use%20Dynamic%20Arrays%20to%20automatically%20%22Spill%20Down%22%20the%20formulas%20as%20new%20rows%20appear%20in%20the%20Pivot%20Table.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20option%20to%20consider%20is%20to%20use%20Power%20Query%20to%20pull%20the%20data%20into%20the%20new%20sheet.%26nbsp%3B%20This%20would%20require%20clicking%20the%20refresh%20button%20to%20pull%20in%20the%20new%20rows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDo%20you%20have%20Excel%20365%20(test%20by%20checking%20if%20you%20have%20the%20%3DSEQUENCE%20function)%20and%20have%20you%20used%20Power%20Query%20before%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1815499%22%20slang%3D%22en-US%22%3ERe%3A%20Automatically%20insert%20rows%20on%20worksheet%20linked%20to%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815499%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9832%22%20target%3D%22_blank%22%3E%40Wyn%20Hopkins%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20just%20tried%20to%20create%20a%20dynamic%20array%20on%20my%20worksheet%20that%20links%20to%20my%20pivot%20table%2C%20but%20i%20got%20a%20%23REF!%20error.%26nbsp%3B%20I%20just%20entered%20the%20cell%20reference%20from%20the%20pivot%20and%20put%20a%20%23%20after%20it%2C%20like%20'Pivot!%22B6%23.%20But%20I%20haven't%20created%20a%20dynamic%20array%20before%2C%20so%20maybe%20i%20did%20it%20wrong%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20vaguely%20familiar%20with%20power%20query%2C%20but%20don't%20know%20how%20to%20use%20it%20to%20build%20off%20my%20pivot%20table.%20But%20i%20wouldn't%20mind%20having%20to%20simply%20click%20refresh%20to%20update%20the%20linked%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELastly%2C%20i%20do%20have%20excel%20365.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20tips!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1835896%22%20slang%3D%22en-US%22%3ERe%3A%20Automatically%20insert%20rows%20on%20worksheet%20linked%20to%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1835896%22%20slang%3D%22en-US%22%3EHi%2C%20%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20%23%20reference%20is%20used%20to%20reference%20an%20existing%20dynamic%20array%20rather%20than%20a%20Pivot%20Table.%3CBR%20%2F%3EThe%20concept%20can%20be%20that%20you%20reference%20a%20range%20with%20many%20more%20rows%20than%20the%20Pivot%20and%20then%20use%20a%20FILTER%20function%20to%20remove%20the%20empty%20rows%20dynamically...%3CBR%20%2F%3E%3CBR%20%2F%3EBUT...%20%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20clarify%20if%20you%20are%20manually%20adding%20any%20data%20to%20the%20new%20rows%20that%20get%20auto-added%20to%20the%20linked%20worksheet.%20I'm%20thinking%20there%20may%20be%20a%20risk%20that%20a%20new%20item%20gets%20added%20in%20a%20different%20row%20of%20the%20Pivot%20table%20and%20your%20inputs%20(if%20any)%20on%20the%202nd%20sheet%20would%20end%20up%20mis-aligned.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20this%20isn't%20a%20risk%20then%20I%20can%20mock%20up%20a%20quick%20Power%20Query%20demo%20for%20you%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1836451%22%20slang%3D%22en-US%22%3ERe%3A%20Automatically%20insert%20rows%20on%20worksheet%20linked%20to%20Pivot%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1836451%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F844691%22%20target%3D%22_blank%22%3E%40Gregger%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnother%20option%2C%20since%20you%20are%20using%20Excel%20365%2C%20is%20to%20use%20the%20SORT%2FUNIQUE%20functions%20on%20the%20source%20data%20to%20build%20lists%20of%20the%20candidate%20row%20and%20column%20headers.%3C%2FP%3E%3CP%3EYou%20could%20then%20use%20the%20lists%20to%20pull%20data%20from%20the%20Pivot%20Table%20using%20GETPIVOTDATA%20by%20using%20them%20as%20an%20array%20of%20parameters.%26nbsp%3B%20Errors%20returned%20by%20missing%20data%20rows%20could%20be%20replaced%20by%20blanks%20or%20filtered%20out.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I'm using Excel in Office 365. I have a worksheet linked to a Pivot Table in the same workbook. The worksheet is linked via cell references on the pivot table table. Here's the problem: Whenever new rows of data are added to the pivot table, the worksheet does not automatically update with these new rows. I have to go to the worksheet and manually drag down the formulas so they reference the new pivot table rows. This happens in reverse when rows are deleted from the pivot table. I have to manually delete rows on the worksheet so they match the pivot table.

 

Example: 1) The pivot table contains 10 rows and the linked spreadsheet shows those 10 rows. 2) The pivot table is refreshed and now has 20 rows, but the linked spreadsheet still only shows 10 linked rows. 3)Then I have to go to the worksheet and manually change the cell references to include the 10 new rows from the pivot table.

 

Is there a way to have my data on the linked worksheet automatically adjust for changes in the number of rows on the Pivot table? Thanks for your help

7 Replies

Hi @Gregger 

 

If you have Office 365 then it is possible to use Dynamic Arrays to automatically "Spill Down" the formulas as new rows appear in the Pivot Table.

 

Another option to consider is to use Power Query to pull the data into the new sheet.  This would require clicking the refresh button to pull in the new rows.

 

Do you have Excel 365 (test by checking if you have the =SEQUENCE function) and have you used Power Query before? 

 

Hi @Wyn Hopkins 

 

I just tried to create a dynamic array on my worksheet that links to my pivot table, but i got a #REF! error.  I just entered the cell reference from the pivot and put a # after it, like 'Pivot!"B6#. But I haven't created a dynamic array before, so maybe i did it wrong?

 

I'm vaguely familiar with power query, but don't know how to use it to build off my pivot table. But i wouldn't mind having to simply click refresh to update the linked table.

 

Lastly, i do have excel 365. 

 

Thanks for the tips!

Hi,

The # reference is used to reference an existing dynamic array rather than a Pivot Table.
The concept can be that you reference a range with many more rows than the Pivot and then use a FILTER function to remove the empty rows dynamically...

BUT...

Can you clarify if you are manually adding any data to the new rows that get auto-added to the linked worksheet. I'm thinking there may be a risk that a new item gets added in a different row of the Pivot table and your inputs (if any) on the 2nd sheet would end up mis-aligned.

If this isn't a risk then I can mock up a quick Power Query demo for you



@Gregger 

Another option, since you are using Excel 365, is to use the SORT/UNIQUE functions on the source data to build lists of the candidate row and column headers.

You could then use the lists to pull data from the Pivot Table using GETPIVOTDATA by using them as an array of parameters.  Errors returned by missing data rows could be replaced by blanks or filtered out.

@Peter Bartholomew 

IMHO, GETPIVOTDATA in particular and all cube formulas in general add load of headache if data source is updated in range. With data source pivoted in the same workbook and result returned / linked to another table Power Query could be more proper solution.

@Sergei Baklan I am perfectly content to go with your opinion on the matter.  I only very rarely get involved with data analysis and on those occasions that I do, I spend too much time fighting with PT defaults that I don't want.  Added to that, I always forget the need to refresh the data at least once.

 

What I did remember was that GETPIVOTDATA (now working as a dynamic array formula) was more reliable than trying to address cells directly and gave me scatter charts as well as bar charts that held their formatting when series disappeared.  Now I tend to ignore pivot tables and use dynamic arrays but that is merely a reflection of the work I encounter, given the need or opportunity I rather like exploring Power Query.

@Peter Bartholomew @Sergei Baklan @Wyn Hopkins @

 

Hey Guys, Thanks for the suggestions! I'll spend some time giving them a try over the weekend and let you know what happens.

 

Thanks!!!