ICAEW.com works better with JavaScript enabled.
Exclusive

Excel update – Power Query can now use Dynamic Arrays as a data source

Author: Simon Hurst

Published: 06 May 2021

Exclusive content
Access to our exclusive resources is for specific groups of students, users, subscribers and members.

Up to a week or so ago, the Data Ribbon tab, Get & Transform Data group included a From Table/Range command that would create a new Power Query query from an Excel Table, a named Range or from a selected block of cells that would be turned into an Excel Table as part of the process. In the Insider, Beta Channel edition of Office 365, this option has now been renamed as From Sheet. This change in name is a result of the expansion of the available data sources within an Excel worksheet to include Dynamic Arrays.

Dynamic Arrays were introduced about 3 years ago and represented a significant change in the way the Excel calculation engine worked. A single Dynamic Array formula would spill into as many cells as it required to represent the entire array in individual cells. The article archive includes many articles on Dynamic Arrays, the new Dynamic Array functions and how other functions can use Dynamic Arrays. You can search the archive on the Excel Community or Tech Faculty articles pages or use the Power BI based archive portal. Dynamic_Array has been set up as a keyword so you can locate most of the relevant articles with a single click:

Image of an Excel dynamic array

The portal can be accessed directly here:

Allow Microsoft Cookies

This content is provided by Microsoft Power BI. We ask for your permission before anything is loaded, as they are using cookies and other technologies. You may want to read Microsoft's privacy policy before accepting. To view this content, please choose Allow all cookies.

Just click on the bottom right-hand corner icon to enter full screen view and press the Escape key to return to this post.

If you have created a Dynamic Array, either by referring to a range of cells in a formula or through the use of one of the new Dynamic Array functions, you can select any cell in the spilled range and use the newly-renamed Data Ribbon tab, Get & Transform Data group, From sheet command to read the contents of the entire spilled range into Power Query. In fact, Power Query is not linked to the Dynamic Range directly. Instead, From Sheet first creates an Excel Range Name that refers to the formula cell in the Dynamic Range using the # operator:

=Tonbridge!$J$6#

Power Query then uses this Range Name, just as it would any Excel Range Name, as the data source for the query:

= Excel.CurrentWorkbook(){[Name="FromArray_4"]}[Content]

One use of the new From Sheet command in relation to Dynamic Arrays would be as a quick method of creating a Range Name that refers to the entire Dynamic Array. By using From Sheet and then closing and discarding the query, the Range Name will be automatically created but without creating the query itself.

So far, I am struggling to come up with any other earth-shattering use for this new capability. It might be useful if you need to create the Dynamic Array anyway, but otherwise it might make more sense just to read the original range that the Dynamic Array refers to into Power Query, and perform whatever operations you could have used the Dynamic Array functions to perform using Power Query itself. Perhaps the FILTER() function might be useful in that it can use values in other Excel cells as the criteria to dynamically change the resulting array of cells. However, given that basing a Power Query on such a range would require a refresh operation anyway, the criteria cells could be read into Power Query to perform the filter on the original data range as part of the query.

On the other hand, using Dynamic Arrays as an intermediate step between the original data and Power Query does give the opportunity to use Excel functions that can perform an operation more simply than their Power Query alternative. By the time you read this I might have come across some brilliant use for this new feature. If you get there before me, please let us know at excel@icaew.com

Excel community

This article is brought to you by the Excel Community where you can find additional extended articles and webinar recordings on a variety of Excel related topics. In addition to live training events, Excel Community members have access to a full suite of online training modules from Excel with Business.

Excel polaroid
Topics
Open AddCPD icon

Add Verified CPD Activity

Introducing AddCPD, a new way to record your CPD activities!

Log in to start using the AddCPD tool. Available only to ICAEW members.

Add this page to your CPD activity

Step 1 of 3
Download recorded
Download not recorded

Please download the related document if you wish to add this activity to your record

What time are you claiming for this activity?
Mandatory fields

Add this page to your CPD activity

Step 2 of 3
Mandatory field

Add activity to my record

Step 3 of 3
Mandatory field

Activity added

An error has occurred
Please try again

If the problem persists please contact our helpline on +44 (0)1908 248 250