How to use dynamic array functions in Microsoft Excel


When I first discovered Excel’s dynamic array functions, my entire approach to spreadsheet design shifted. They replaced my clunky, multistep workarounds with smart, self-expanding formulas that adapt as data grows, turning complex workflows into single-cell systems.

If you’re still managing your datasets using manual copy-paste routines or dragging fragile formulas down thousands of rows, mastering these core functions will completely transform how you interact with Excel.

Core dynamic array functions are available in modern versions of Excel, including Microsoft 365, Excel 2021, Excel 2024, and Excel for the web.

How dynamic arrays change data flow in Excel

The end of CSE and the rise of the spill range

Traditionally, Excel formulas produced one result in one cell, forcing you to copy calculations down an entire column. Dynamic arrays fundamentally change this workflow by allowing a single formula to output a block of data that automatically expands or contracts based on the source size.

This behavior is called spilling. When you type a formula and press Enter, the data populates an area marked by a thin blue border known as the spill range. Importantly, this capability comes from an upgraded calculation engine rather than just a new set of functions. In modern Excel, formulas can return multiple results, and both new and existing functions can spill into neighboring cells when required. This replaces the need for old Ctrl+Shift+Enter (CSE) array formulas, which are notoriously difficult to build and troubleshoot.

Isolate specific rows without clicking any buttons

In the past, filtering an Excel dataset meant using the “Filter” button on the ribbon, ticking boxes, and copying results elsewhere. But the moment the source data changed, those results became outdated.

The FILTER function replaces that workflow entirely. Instead of hiding rows, it returns matching data into a separate spill range:

=FILTER(array, include, [if_empty])

Suppose you have an Excel table named EmployeeMaster. When you select a region in cell G2, you want the matching results to spill from cell I2.

An Excel worksheet containing a data grid of employee records alongside a region cell and an empty destination cell for an output range.

After entering the following formula in I2, the output updates automatically when the data changes or when a different region is selected:

=FILTER(EmployeeMaster, EmployeeMaster[Region]=G2, "Region not found")

SORTBY: Organize lists pragmatically

From fixed ordering to reference-driven sorting

Basic ribbon sorting (“A–Z”) works for reordering static lists, but it quickly breaks down in dynamic dashboards where new rows are continuously added to the dataset. Excel’s SORT function already improves on this by turning ordering into a formula-based operation. However, it relies on column positions, which makes it fragile when your dataset structure changes over time.

A more flexible approach is the SORTBY function, which removes that dependency entirely. Instead of sorting by column index, it sorts using explicit reference arrays—meaning your logic is tied to the data itself, not its physical layout. This shifts sorting from positional logic to data-driven logic, which is far more resilient in real-world dashboards:

=SORTBY(array, by_array, [sort_order])

For example, in the EmployeeMaster dataset, you can sort directly by MonthlySales without relying on column position or altering the underlying dataset:

=SORTBY(EmployeeMaster, EmployeeMaster[MonthlySales], -1)
An Excel workbook showing a SORTBY formula applied to arrange the entire master dataset in descending order based on the MonthlySales column values.

Because it references the field directly using a structured reference, the sorting layer survives structural changes to the dataset. At this point, you’re no longer managing calculations—you’re defining how data flows through the workbook.


An Excel spreadsheet with '=A2#' written on it and a blurred laptop in the background.


You need to know what the hash sign does in Excel formulas

Smash the hash in a flash!

UNIQUE: Clean up messy data by removing duplicates

Strip away repetitive entries to build clean dimensions

Building clean lists of departments, names, or IDs in Excel used to require destructive tools like “Remove Duplicates”, which don’t respond to new data.

Now, the UNIQUE function returns a live list of distinct values:

=UNIQUE(array, [by_col], [exactly_once])

For example, typing:

=UNIQUE(EmployeeMaster[Department])

into cell P1 scans your table and produces a clean list of unique departments that expands as new ones are added to the source dataset.

An Excel worksheet showing a UNIQUE formula used to extract a list of distinct values from the Department column into a clean spill range.

If you need a fully contained, single-cell pipeline, you can combine FILTER, UNIQUE, and SORTBY to extract data, remove duplicates, and apply a strict order in one formula.

OS

Windows, macOS, iPhone, iPad, Android

Free trial

1 month

Microsoft 365 includes access to Office apps like Word, Excel, and PowerPoint on up to five devices, 1 TB of OneDrive storage, and more.


XLOOKUP: Retrieve data arrays without breaking layouts

Pull multiple adjacent columns simultaneously from a single lookup value

The XLOOKUP function is often framed as merely a replacement for VLOOKUP, but its real strength in modern Excel lies in how naturally it fits the spill model. It can return entire records instead of single values, spilling results horizontally when given a multi-column return range, without depending on column positions.

Here’s the syntax:

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

In our EmployeeMaster table, you can retrieve full employee details by passing a lookup target from cell G2, matching it against the ID column, and setting the return array to span multiple headers:

=XLOOKUP(G2, EmployeeMaster[EmployeeID], EmployeeMaster[[EmployeeName]:[MonthlySales]])

The result spills horizontally from the formula cell into adjacent columns, and because it’s not dependent on fixed column indexes, it remains stable even if the table structure changes.

An Excel worksheet showing an XLOOKUP formula configured to return a multi-column array of data for a specific employee ID.


Illustration of the Excel XLOOKUP function with large arrows pointing right and down across a green spreadsheet, showing multiple criteria cells highlighted around it.


How to Use XLOOKUP With Multiple Criteria in Excel

XLOOKUP is more versatile than you think.

VSTACK and HSTACK: Combine scattered data sources

Fast, formula-native layout stacking without heavy tooling

Consolidating separate Excel datasets has traditionally required manual copying or using Power Query. For lighter, formula-first workflows, VSTACK (vertical stack) and HSTACK (horizontal stack) let you combine arrays directly inside cell calculations without launching external data-prep tools. This makes them ideal for fast, formula-first data assembly.

The syntax for stacking vertically is:

=VSTACK(array1, [array2], ...)

And to stack horizontally, you use:

=HSTACK(array1, [array2], ...)

This workflow shines when you have separate tables representing simple, cyclical logs. For example, suppose you have three Excel tables containing quarterly employee metrics (Q1_Master, Q2_Master, and Q3_Master). You can stack them end-to-end by typing:

=VSTACK(Q1_Master, Q2_Master, Q3_Master)

This creates a single unified dataset right in your grid that appends the rows seamlessly and reflects changes in the source tables without manual consolidation.

Beyond the core dynamic array functions

Capability map of Excel’s spill-based tools

Once you understand the core dynamic array functions, Excel extends the same spill-based model into a wider set of specialized options:

Capability

Functions

Generate data

SEQUENCE, RANDARRAY

Lookup utilities

XMATCH

Reshape arrays

TAKE, DROP, CHOOSECOLS and CHOOSEROWS

Reformat layouts

WRAPROWS and WRAPCOLS, TOCOL and TOROW

Text parsing

TEXTSPLIT, TEXTBEFORE, and TEXTAFTER

Aggregation

GROUPBY, PIVOTBY

Custom logic

LET, LAMBDA

Iteration tools

MAP, REDUCE, SCAN, BYROW, BYCOL, MAKEARRAY

Together, these extend the same principle throughout Excel: data is no longer processed manually, but continuously reshaped through connected formula layers.


Mastering the future of spreadsheets

Dynamic arrays are among the most transformative changes Microsoft has made to Excel in years, replacing clunky legacy workflows with a model where data updates, reshapes, and recalculates as the workbook evolves. As you start making the most of this modern workflow, knowing how to fix Excel #SPILL! errors will help keep everything running smoothly.



Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


I consider myself part of many fandoms. Some are from my childhood, others from college, and now, as a young adult, but they all mean something to me on some level. One of those just happens to be Star Wars.

For years, I have adored the Star Wars franchise, mainly because I grew up on those movies. But I must admit, the best Star Wars film isn’t one of the classics from the 1970s and 1980s. No, it’s actually a rather new one—and it’s time you gave it the praise it deserves.

Rogue One is the best Star Wars movie by far

It simply can’t be beaten

Jyn Erso in Rogue One: A Star Wars Story speaking to someone. Credit: Lucasfilm

So hear me out.

What are my credentials to say this? Really, none except for the fact that I grew up watching the entire franchise, as I’m sure most people reading this article did. I am a fan whose brother was obsessed with Luke Skywalker and Han Solo and whose father would meticulously quote Yoda as if he were real. I was raised on Star Wars, both the Star Wars movies and TV shows.

So I must admit that I’ve watched the first movies a few times, the prequel films many times, and, of course, the sequel movies. And they’re all great. Trust me. They are. But to me, Rogue One, otherwise known as Rogue One: A Star Wars Story, is the best film in the series.


Star Wars logo.


8 Classic Star Wars Games Every Fan Should Play At Least Once

Enjoy these games, you will.

You can’t really surpass some of the iconic moments that have cemented themselves into movie history from the originals, such as the legendary reveal of Darth Vader being Luke’s father, Han and Leia’s love exchange, and, of course, the epic lightsaber fights that happen in both the original films and the prequels.

But I think what makes Rogue One the best Star Wars film is that it’s the perfect movie set in the Star Wars universe, with a plot that matters without trying to be anything else. It doesn’t aim to become bigger than it originally was—a story about a group of rebels who begin the entire story of A New Hope thanks to what they did.

The characters make it so much more enthralling

My favorite ones come from here!

I think what really stands out in Rogue One is the memorable characters. One was so memorable and beloved that Disney created a critically acclaimed TV show about the character. That’s how you know they were good.

But they weren’t just well-written characters with complex backstories and interesting comedic bits. They were likable. I feel like a lot of Star Wars characters fall into an unlikable trap.

There are plenty of characters who are likable and memorable, but I’m not entirely sure their stories are as fleshed out, so we see their flaws much more easily. I honestly think a big reason fans didn’t like Rey as much was that her story didn’t feel as well-told. They tried to make her bigger than she needed to be—her original story, of just being a random girl with the Force who had no connection to anything else, felt a lot more original than her being a granddaughter of Palpatine.

That’s what makes Jyn Erso (played by Felicity Jones), the main protagonist of Rogue One, so good. Yes, she is the daughter of an Imperial scientist, but she doesn’t have any powers, secret abilities, or anything like that. She’s a rebel who aims to help and is very human and flawed but does her best. Those traits are carried out throughout every character we meet in Rogue One, including Cassian Andor (Diego Luna).​​​​​​​

The action and special effects are top-tier

The BEST blaster fights

A ship explodes from bombs in Rogue One: A Star Wars Story. Credit: Lucasfilm

I know for a fact that the sequel films fell into a bad rhythm with their action. It didn’t feel as well-choreographed or as well-executed as the special effects in previous films. But with Rogue One? It never feels like that.

I honestly believe it’s because the movie is more grounded in war than in epic space battles and moving things with the force all the time. It’s about a group of humans and droids who are trying to work together to bring an end to the Empire. Most of them don’t really have powers, and that leads to some really well-done sequences that feel real in ways where even we could relate to them.

Of course, there’s that epic final scene of Darth Vader basically destroying and killing everyone with his skills and the force, but that doesn’t feel pushed into the story. That feels authentically woven into the storyline and done in a way that shows his power and how it connects to the overall story. That’s an effective way to use that kind of power.

War-focused action with a little hint of those special effects made this so much better.

The original films are still great, but just not my favorite

Jyn and Cassian have my heart

I’m not saying I don’t love the original Star Wars movies because that is not the case. I love the originals and the sequels with a heavy passion. There’s a reason why most Star Wars board and card games are centered around those characters—we love them because we grew up with them.

From a theatrical perspective, with its compelling story, well-developed characters, and impressive effects, Rogue One stands out as the supreme leader of the series. I genuinely cannot find a fault in this film within the grand timeline of the Star Wars universe, and honestly, I wish we got more of movies like this.

Grounded Star Wars feels so much more relatable, and I think that’s a big reason why Rogue One is successful. As much as we love the powers and the Force and epic lightsaber fights, we would all most likely be like Jyn or Cassian, rebels trying to fight for the greater good. And I think that’s beautiful.

Either way, we’ll still be getting plenty of new Star Wars content soon, including a Darth Maul show, apparently. Maybe something new will surpass Rogue One. But for now, I doubt it. And if you haven’t seen Rogue One, you should check it out on Disney+.

Subscription with ads

Yes, the Disney Basic plan

Simultaneous streams

Up to 4




Source link