Blog Post

Excel Blog
3 MIN READ

Preview of Dynamic Arrays in Excel

JoeMcDaid's avatar
JoeMcDaid
Icon for Microsoft rankMicrosoft
Sep 25, 2018

July 1st 2020 Update
Dynamic Arrays is now available to Office 365 users on all endpoints. 

 

Until now, you wrote a formula for each value you wanted returned to the grid. One formula, one value. If you wanted another value, you wrote (or copied) another formula. With dynamic arrays, that all changes. Now, you can write a formula hit the enter key and get an array of values returned. One formula, many values. This will allow you to build more capable spreadsheets, faster, with fewer formulas and less chance of error.
 
To harness the power of dynamic arrays, we’ve added some amazing new functions. So, for instance, you can use the SORT function to sort a list, the UNIQUE function to remove duplicates from that list, then use the FILTER function to get just what you want from the list. And when your data changes, the dynamic array will resize and recalculate automatically! 
 

Dynamic arrays in actionSpilling

We call the behavior of placing values in neighboring blank cells "spilling”, and you’ll see Excel indicate the formula’s “spill range" with a thin blue border when you select any cell inside the spill range.
 
Don’t worry about the spill range overlapping your data--if there isn’t enough space, the formula will roll up and show an informative #SPILL error. When you select the #SPILL error, the formulas desired spill range will be indicated by a dashed blue border. Just move or delete the obstructing data and your formula will automatically spill.
 
Spilling range not blank
Native to Excel
Dynamic array support is deeply integrated into Excel and it's not limited to the functions shipping alongside it -- any newly authored formula that returns an array will spill. For instance, entering =A3:A13 into B3 will cause the values in A3:A13 to be spilled into B3:B13. And just like Excel's grid, dynamic arrays can be 2 dimensional as shown in the multiplication table example below.
 
 Using dynamic arrays with existing functions
Referencing the spill range using A1# notation
Dynamic arrays may seamlessly resize as your data changes. To make it easy to reference resizing dynamic arrays, we are adding a way to reference the entire spill in a dependable, resilient way. You can do this by following a cell reference with the # symbol, for example A1#. This is equivalent to referencing the entire spilled range for the dynamic array in A1. We'll default to this style reference whenever you write a formula that refers to the entire spill range.
 
In the example below notice how the SUMIF function is using all the product names from the dynamic array in D5. When Grapes is added to the sales table, the D5 spill range grows and so does the result of the SUMIF because it references D5# rather than D5:D8.
 
 Using # to refer to the spill range
New Functions
Here is the full set of functions that will be accompanying dynamic arrays.
 
FILTER - filters an array of data based on criteria you define.
UNIQUE - returns a list of unique values from a list or range.
SORT - sorts an array of values.
SORTBY - sorts an array based on a corresponding array.
SEQUENCE - generates a list of sequential numbers, such as 1, 2, 3, 4.
RANDARRAY - returns an array of random numbers between 0 and 1.
 
We cannot wait to see how our users use these new building blocks in their spreadsheets.
 
Learn More
You can learn more about dynamic arrays from these resources:
 
 
Availability notes:
Dynamic arrays functionality is available in Preview for users signed up for the Office 365 Insiders Program starting today. We will initially roll out to a subset of Insider users on Windows so that we can gather feedback and monitor feature quality. Over the next few months, we'll be increasing the number of Insider users with access to dynamic arrays and light up support for Excel on Mac, web, and mobile. You’ll know if you have dynamic arrays if you see any of the new functions in your formula autocomplete when you start typing a formula.
 
To stay connected to Excel and its community, read Excel blog posts, and send us ideas and suggestions for the next version of Excel through UserVoice. You can also follow Excel on Facebook and Twitter.
 
Joe McDaid (@jjmcdaid)
Program Manager, Excel
Updated Oct 05, 2020
Version 11.0

266 Comments

  • Phil Trick's avatar
    Phil Trick
    Copper Contributor

     Loving the new spill concept and new functions. Will vastly improve dynamic named ranges so that no longer is it an offset with a calculated height and width but just $F$5#.

     

    And thank you for native UNIQUE and SORT functions. I can't wait to retire my Excel VBA QuickSort / Unique library plus this reduces the number of functions I need to rewrite in the Javascript API, so double points.

     

     

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Awesome!

    But, I hope you update Excel 2019 to include these new features!

    Please do not just limit them to Excel for Office 365.

  • Jon Wittwer's avatar
    Jon Wittwer
    Copper Contributor

    This is awesome! I've been hoping that Excel would add the UNIQUE and SORT functions that have been available in Google Sheets, but I am even more impressed that Excel has done far more than just adding these functions. I can't wait to see what I can do with the new A1# notation (I'm really hoping it can be used in data validation dropdowns). And the SEQUENCE function is brilliant - ought to make creating advanced formulas easier (and hopefully without being volatile).

  • Thank you - this is a very exciting feature.

    I have a few initial questions:

    • Can dynamic arrays be used with RTD-based functions? Currently there are some bugs (including buggy RTD topic disconnect) when RTD is called from legacy CSE array formulae (even if the RTD call is through an indirection). It would be an immense help if there were RTD support in conjunction with the dynamic arrays, for async, streaming and other scenarios.
    • Do I understand correctly that any UDF defined in a .xll add-in which returns an XLOPER will automatically work with the dynamic array behaviour? Can I effectively recreate a "FILTER" or "SORT" function inside an add-in or do these functions themselves have internal magic too? Is "SINGLE" special or can I opt into implicit intersection behaviour from inside my array-returning UDF function by calling SINGLE via the C API?
    • Can dynamic arrays be used inside Tables? Currently array functions cannot be put in Tables. It would be great to have the auto-expanding and shrinking Table behaviour anchored on a synamic array function.
    • How does the # spill operator impact the reference passed to a function taking an XLOPER reference parameter in the C API? Is there any way to know that a parameter is a dynamic array (as opposite to a fixed, explicit range)?
    • How is the caller identified for dynamic array functions (via xlfCaller in the C API or Application.Caller in VBA)?
  • Emma Bailey's avatar
    Emma Bailey
    Iron Contributor

    This is super exciting! I use the FILTER function in Google Sheets so having this functionality come to Excel is great.  I can already see several ways these new features are going to help out in my work, so I’m looking forward to trying them (and hoping to be in the initial Insider testing group to get them sooner!)

  • Ed Hansberry's avatar
    Ed Hansberry
    Bronze Contributor

    This is incredible. I cannot wait to try them out.

     

    I am on Insider Fast in Office 365 but they don't exist for me yet. I think it is a shame that even if we sign up for Insider Fast the rollout of new features to try is spread out. I thought the point of Insider Fast was to get the latest publicly available features, not to sign up to be on a list to randomly get the latest features.