EXPAND grows an array to a set size, filling the new cells with a value you choose. Handy for forcing results to a fixed shape or padding ragged data before stacking.
#N/A.
The example
A 3-row array padded to 5 rows with 0.
| A | B | |
|---|---|---|
| 1 | Original | Expanded |
| 2 | 10 | 10 |
| 3 | 20 | 20 |
| 4 | 30 | 30 |
| 5 | 0 |
The formula
Grow to a fixed shape, padding the rest:
How it works
EXPAND resizes and fills:
- Arguments: the array, target rows, target columns, and the pad value.
- New cells beyond the original data are filled with the pad value (default
#N/A— usually set 0 or ""). - You can grow rows, columns, or both. EXPAND never shrinks — the target must be ≥ the original size.
- It’s most useful for making arrays the same shape before combining them with VSTACK/HSTACK.
Even up before stacking: when two ranges have different widths, EXPAND the narrower one to match, then VSTACK them without ragged-array errors. Pad with "" for clean blanks in a report.
Try it: interactive demo
Values + target rows + pad value.
Variations
Pad with blank
Empty string fill:
Grow columns
Widen instead:
Even up then stack
Match shapes:
Pitfalls & errors
Can’t shrink. The target rows/cols must be at least the original size, or EXPAND returns #VALUE!.
Default pad is #N/A. Omitting the pad value fills with #N/A — usually you want 0 or "".
365 only. EXPAND is a dynamic-array function.
Practice workbook
Frequently asked questions
What does the EXPAND function do in Excel?
How do I avoid #N/A in the padded cells?
Can EXPAND make an array smaller?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class