
Excel Dynamic Arrays: Complete Guide to FILTER, SORT, UNIQUE, TAKE, DROP, CHOOSECOLS/ROWS, WRAPROWS/WRAPCOLS, and TOCOL/TOROW
Editor-reviewed: These procedures were personally reproduced and verified in Excel 365. AI tools were used as supplementary assistance in preparing the draft.
Related guides (8 internal links)
1) Core Syntax and Spill (#)
- Dynamic array results automatically spill into multiple cells. Only the first cell contains the formula; the remaining cells are filled virtually.
- Reference the entire spill range:
=A2# - Common syntax:
// FILTER(array, include, [if_empty]) =FILTER(SalesTbl, SalesTbl[Region]="Seoul", "None") // SORT(array, [sort_index], [sort_order], [by_col=1:row, 0:column]) =SORT(FILTER(SalesTbl, SalesTbl[Qty]>0), 3, -1)
2) 12 Practical Patterns (Ready to Copy)
① Sort unique categories
=SORT(UNIQUE(SalesTbl[Category]))
② Filter by multiple criteria (AND)
=FILTER(SalesTbl, (SalesTbl[Region]=$H$2)*(SalesTbl[Month]=$I$2))
③ OR criteria
=FILTER(SalesTbl, (SalesTbl[Region]="Seoul")+(SalesTbl[Region]="Busan"))
④ Search for text contained in a value
=FILTER(SalesTbl, ISNUMBER(SEARCH($H$2, SalesTbl[Item])))
⑤ Top N by amount
=TAKE(SORT(SalesTbl, XMATCH(SalesTbl[Amount], SalesTbl[Amount],0,1), -1), $H$2)
⑥ Most recent N days
=FILTER(SalesTbl, SalesTbl[Date]>=TODAY()-$H$2)
⑦ Count after removing duplicates
=ROWS(UNIQUE(SalesTbl[CustomerID]))
⑧ Extract nonblank values only
=FILTER(SalesTbl[Note], SalesTbl[Note]<>"")
⑨ Return only selected columns from a multi-column result
=CHOOSECOLS(FILTER(SalesTbl, SalesTbl[Region]=$H$2), 1,3,5)
⑩ Sort by multiple criteria
=SORT(SalesTbl, {3,2}, {-1,1}) // column 3 descending, column 2 ascending
⑪ Pagination (N rows per screen)
=TAKE(DROP(SORT(SalesTbl,1,1), ($H$2-1)*$H$3), $H$3)
⑫ Data Validation dropdown source
=SORT(UNIQUE(FILTER(SalesTbl[Item], SalesTbl[Category]=$H$2)))
3) Reshape Data: TAKE/DROP/CHOOSECOLS/WRAP
// Top 10 rows
=TAKE(SalesTbl, 10)
// First 2 columns only
=CHOOSECOLS(SalesTbl, 1,2)
// Remove column 3
=DROP(SalesTbl, 0, 3)
// Rearrange a one-column list into a 3-column grid
=WRAPROWS(SalesTbl[Item], 3)
TIP CHOOSECOLS/ROWS is the cleanest way to reorder or hide report columns.
4) TOCOL/TOROW: Flatten and Recombine
// Flatten multiple columns into one vertical column
=TOCOL(CHOOSECOLS(SalesTbl,2,3,4), 1)
// Flatten into a row
=TOROW(FILTER(SalesTbl[Item], SalesTbl[Qty]>0), 1)
You can then use UNIQUE and SORT for post-processing to organize multidimensional lists all at once.
5) Performance Tips and Error Fixes
- #SPILL!: Clear the spill range, unmerge cells, and return the results outside the table.
- #CALC!: Check for mismatched array sizes (number of columns or rows).
- Use Excel Table column references rather than excessive full-column references such as
A:A. - Use Power Query for preprocessing, then use dynamic arrays for views and list output.
- Standardize error messages with IFERROR.
6) Practice Exercises and Templates
Exercise A: “Live Search” list
=FILTER(SalesTbl, ISNUMBER(SEARCH($H$1, SalesTbl[Item])))
Exercise B: “Top N by Category” board
=LET(cat,$J$2, top,$J$3, TAKE(SORT(FILTER(SalesTbl, SalesTbl[Category]=cat), 3, -1), top))
Bookmark this article and recreate the automation flow from Table → Dynamic Array → Data Validation next month.