Dynamic arrays in Excel turn filtering, sorting and removing duplicates from manual chores into single spill formulas that update themselves. Every change broke something, and every refresh required rebuilding.
Dynamic arrays changed that. Since Excel 365 and Excel 2021, functions like FILTER, SORT, and UNIQUE return a range of results that “spill” into the cells below and to the right. One formula, one spill, one clean result. No more helper columns, no more manual filtering, no more array formulas with strange bracket syntax.
In this article, I will explain how dynamic arrays in Excel work, walk through the three most useful functions — FILTER, SORT, and UNIQUE — and show real examples that make them worth learning.

What Are Dynamic Arrays in Excel?
A dynamic array is a formula that returns more than one value. Instead of returning a single result, dynamic array formulas return a block of values that spill into neighboring cells.
Example:
=UNIQUE(A2:A100)
If column A has 50 unique values among 100 entries, this formula spills 50 values down from wherever you typed it. You did not select a range. You did not press Ctrl + Shift + Enter. It just works.
Spill behavior is the key. Excel looks at the formula and automatically reserves the space it needs. If something is in the way, you get a #SPILL! error. Otherwise, it fills the cells below.
If you click inside a spill range and press Ctrl + A, Excel selects the entire spilled area. This is useful for formatting or referencing the whole range in other formulas.
Three Key Dynamic Array Functions
There are dozens of dynamic array functions, but the three most useful are FILTER, SORT, and UNIQUE. Learn these three and you cover 80% of real use cases for dynamic arrays in Excel.
FILTER — Extract Rows That Match
FILTER returns rows from a range that meet a condition. The syntax is:
=FILTER(array, include, [if_empty])
- array: the range to filter
- include: the condition (a TRUE/FALSE array)
- if_empty: what to return if no rows match (optional)
Example:
=FILTER(A2:D100, B2:B100=”North”)
This returns all rows from A2:D100 where column B equals “North”. The result spills below the formula.
For multiple conditions:
=FILTER(A2:D100, (B2:B100=”North”)*(C2:C100=”Delivered”))
The * acts as AND. Both conditions must be true.
For OR logic:
=FILTER(A2:D100, (B2:B100=”North”)+(B2:B100=”South”))
The + acts as OR. Either condition is enough.
The if_empty argument prevents #CALC! errors when nothing matches:
=FILTER(A2:D100, B2:B100=”North”, “No data for North”)
Now if no rows match, the formula returns “No data for North” instead of an error.
SORT — Sort the Results
SORT returns a sorted version of a range. The syntax is:
=SORT(array, [sort_index], [sort_order], [by_col])
- array: the range to sort
- sort_index: which column to sort by
- sort_order: 1 for ascending, -1 for descending
- by_col: FALSE for sorting rows (default), TRUE for sorting columns
Example:
=SORT(A2:D100, 2, -1)
This sorts the data in A2:D100 by column 2, in descending order. The result spills below.
SORT is often combined with FILTER:
=SORT(FILTER(A2:D100, B2:B100=”North”), 4, -1)
This filters to North rows, then sorts by column 4 (say, Revenue) descending. The output is a clean, filtered, sorted list that updates automatically.
For multi-level sorting, use SORTBY:
=SORTBY(A2:D100, B2:B100, 1, D2:D100, -1)
This sorts by column B ascending, then by column D descending. Perfect for “region, then revenue” views.
UNIQUE — Remove Duplicates Instantly
UNIQUE returns the unique values from a range. The syntax is:
=UNIQUE(array, [by_col], [exactly_once])
- array: the range to deduplicate
- by_col: FALSE for rows (default), TRUE for columns
- exactly_once: FALSE for all uniques (default), TRUE for values that appear only once
Example:
=UNIQUE(B2:B100)
This returns the unique regions from column B. If the column has North, South, North, East, South, the result is North, South, East — three rows, spilled.
For unique combinations across multiple columns:
=UNIQUE(A2:B100)
This returns unique pairs of values from columns A and B. Useful for finding distinct region-product combinations or customer-status pairs.
For counts of each unique value:
=COUNTIF(B2:B100, UNIQUE(B2:B100))
This returns an array of counts, one for each unique value. Pair with UNIQUE and you have a frequency table in one formula.
SEQUENCE — Generate Numbers Automatically
SEQUENCE generates a sequence of numbers. The syntax is:
=SEQUENCE(rows, [columns], [start], [step])
Example:
=SEQUENCE(10) → returns 1 through 10
=SEQUENCE(5, 3) → returns a 5×3 grid of numbers 1 through 15
=SEQUENCE(12, 1, 1, 1) → returns 1 through 12 (months)
SEQUENCE is useful for generating row numbers, month numbers, and test data. Combined with other dynamic arrays in Excel functions, it becomes a building block for larger formulas.
Example: Generate Month Names
=TEXT(DATE(2026, SEQUENCE(12), 1), “mmm”)
This returns Jan, Feb, Mar, …, Dec — as a spilled array. Useful for building dynamic monthly reports.
Practical Example: Interactive Filter Report
You have a sales table with 5,000 rows. You want a report where the user picks a region from a dropdown and sees all matching rows, sorted by revenue.
In cell F1: a dropdown with regions.
In cell F3: =SORT(FILTER(A2:E5000, B2:B5000=F1), 5, -1)
Now the user selects a region, and the entire table updates: filtered, sorted, and clean. No manual filters, no helper columns, no VBA. That is dynamic arrays in Excel doing the heavy lifting for you.
This is the kind of report that used to require a Pivot Table or a macro. Now it is one formula.
Practical Example: Unique Customer List
You have 5,000 order rows. You want a unique list of customers and how many orders each placed.
Cell F2: =UNIQUE(B2:B5000)
Cell G2: =COUNTIF(B2:B5000, F2#)
The # after F2 references the entire spill range, so COUNTIF fills the whole column automatically.
You now have a customer list and order counts, updated automatically with dynamic arrays in Excel as new orders are added. No manual deduplication, no helper column.
Practical Example: Top N with SORT and TAKE
You want the top 10 salespeople by revenue.
=TAKE(SORT(A2:D5000, 4, -1), 10)
This sorts the entire table by column 4 (Revenue) descending, then takes the first 10 rows. One formula, top 10 results.
TAKE is another dynamic array function. TAKE(array, rows) returns the first N rows. TAKE(array, -10) returns the last 10. It pairs beautifully with SORT and FILTER. Like the other dynamic arrays in Excel, TAKE spills its result automatically.
Combining Functions for Real Power
The real power of dynamic arrays in Excel comes from combining them:
=SORT(FILTER(A2:E5000, (B2:B5000=”North”)*(D2:D5000>10000)), 4, -1)
Filter to North with revenue > 10,000, then sort by revenue descending. One formula, exactly the report you want.
=UNIQUE(SORT(FILTER(B2:B5000, D2:D5000>50000)))
Unique customers who placed orders over 50,000. Three functions chained together, one clean output.
You can also nest SORTBY inside FILTER:
=FILTER(A2:E5000, C2:C5000=”Delivered”)
Or use SORTBY for multi-level sorting after filtering.
The key is that each function returns a range, and other functions consume that range. This composability is what makes dynamic arrays in Excel so powerful.
The # Spill Reference
When a formula spills, you can reference the entire result with the # symbol. For example, if F2 has =UNIQUE(A2:A100), then F2# refers to all spilled values.
This is useful for:
- Referencing the spill range in downstream formulas
- Using the spilled range as data validation source
- Using the spilled range as chart source
Example: Chart from a spill range. Set the chart series to =Sheet1!$F$2# and the chart updates as the spill changes.
Put Dynamic Arrays to Work
Open a workbook with a real table of your own — sales records, a student list, or an expense log with at least 50 rows — and try each function on that data instead of reading about it. Start with =UNIQUE() on one column, such as region or category, and watch the distinct values spill down. Next, add =FILTER() to pull out only the rows you care about, for example orders above a value you choose or entries from one month, and add the if_empty argument so a search with no matches shows a friendly message instead of an error.
Then wrap that result in =SORT() to order it by amount or date, largest first, and try SORTBY when you need two levels of sorting. Now combine all three in one formula: filter, sort, then take the top ten with =TAKE(). Point a second formula at the spill with the # reference, for example =COUNTIF(F2#, “North”), and change a value in the source data to see every result update at once. That instant update is the whole point of dynamic arrays in Excel.
Finally, build a small report: put a dropdown in one cell, link FILTER to that cell, and sort the output so the whole table refreshes when you pick a different value. If you hit a #SPILL! error, look for data blocking the spill and clear it. Spend twenty minutes on your own data and these functions will stick far better than any example you only read.
If you still rely on older lookup formulas, compare XLOOKUP vs VLOOKUP or learn INDEX and MATCH to see when a spill formula replaces them.
Frequently Asked Questions
What Excel versions support dynamic arrays?
Microsoft 365 and Excel 2021 support dynamic arrays in Excel. Excel 2019 and earlier do not.
Can I convert a spill formula to fixed values?
Yes. Select the spill range, copy, then paste as values. The values become static.
Does FILTER slow down Excel with large data?
FILTER is efficient but processes the full array. On very large data (100,000+ rows), it may be slow. Consider Power Query for very large datasets.
Can I use dynamic arrays in charts?
Yes. Reference the spill range with # and the chart updates automatically. This is the cleanest way to build dynamic charts.
What happens to spilled values if I edit the source?
The spill recalculates automatically. If the spill grows or shrinks, Excel adjusts the cells.
Can I use FILTER on text values?
Yes. FILTER works on any data type. Use text comparisons with quotes: =FILTER(A2:B100, C2:C100=”Approved”).
Final Thoughts
Dynamic arrays in Excel are the biggest change to Excel formulas in decades. They replace helper columns, array formulas, and manual filtering with clean, readable, spill-based formulas. FILTER, SORT, and UNIQUE are the three worth learning first. Together, they turn a static spreadsheet into a responsive, self-updating report. If you are on Microsoft 365 or Excel 2021, this is not optional — it is the modern way of doing Excel. Learn it, and you will wonder how you ever managed without it.









