EXPAND function
Enlarges an array to a given number of rows and columns, filling the new cells with a value you choose (or #N/A).
Available in Microsoft 365, Excel 2024, Excel for the web, Excel for Mac 2024+
Excel 2024 and laterNot in Google Sheets
Syntax
EXPAND(array, rows, [columns], [pad_with])| Argument | What it means | |
|---|---|---|
array | Required | The range or array to enlarge. |
rows | Required | The total number of rows wanted. Leave empty to keep the current height. It cannot be smaller than the current height. |
columns | Optional | The total number of columns wanted. Leave empty to keep the current width. |
pad_with | Optional | The value to put in the new cells. Without it they show #N/A. |
Returns: A larger array containing the original values in the top-left and padding elsewhere.
How EXPAND works
EXPAND makes an array bigger. You say how many rows and columns the result should have, and the original values sit in the top-left corner while the extra cells are filled with pad_with. On its own that is a niche need, but it is very useful when you combine arrays of different sizes: VSTACK and HSTACK need matching widths or heights, and EXPAND can pad the smaller piece first.
The rows and columns are total sizes, not the number to add. If you leave pad_with out, the new cells show #N/A, which is easy to spot while building a formula but usually not what you want in a finished report - pass "" for empty-looking cells or 0 for zeros.
Examples
1Pad to four rows with a dash
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Sales | |||
| 2 | Ana | 5400 | Ana | 5400 | |
| 3 | Dev | 4500 | Dev | 4500 | |
| 4 | - | - | |||
| 5 | - | - |
The 2-row array becomes 4 rows; the two new rows are filled with dashes.
2Without a pad value
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Sales | |||
| 2 | Ana | 5400 | Ana | 5400 | |
| 3 | Dev | 4500 | Dev | 4500 | |
| 4 | #N/A | #N/A |
The extra row shows #N/A because no pad_with was given.
3Add an empty column for notes
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Rep | Sales | ||||
| 2 | Ana | 5400 | Ana | 5400 | ||
| 3 | Dev | 4500 | Dev | 4500 |
Rows are left as they are, and a third column of empty text is added.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | rows or columns is smaller than the array's current size. | Ask for at least the current number of rows and columns. |
#N/A | These are padding cells - no pad_with was supplied. | Add a fourth argument such as "". |
Tips
=VSTACK(A1:C1, EXPAND(E2:F5, , 3, ""))stacks a two-column block under a three-column header.- Use EXPAND to reserve space in a dashboard so a spilled list always occupies the same rows.
Google Sheets
Use MAKEARRAY with IFERROR(INDEX(array, r, c), pad_with) to pad an array to a larger size.
EXPAND in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | ROZBALIT |
| Danish | UDVID |
| Dutch | UITBREIDEN |
| Finnish | LAAJENNA |
| French | ETENDRE |
| German | ERWEITERN |
| Hungarian | KITERJESZT |
| Italian | ESPANDI |
| Norwegian (Bokmål) | UTVID |
| Polish | ROZSZERZ |
| Portuguese (Brazil) | EXPANDIR |
| Russian | РАЗВЕРНУТЬ |
| Spanish | EXPANDIR |
| Swedish | EXPANDERA |
| Turkish | GENİŞLET |