How to Change an Array in Excel: Step-by-Step Guide
In this article
To change an array in Excel, you edit the cells that contain the array formula or use the array editing tools in the formula bar. If the array is a dynamic array (Excel 365 and Excel 2021+), you can simply select any cell in the spilled range and type over it, or edit the formula in the top-left cell. For legacy array formulas (entered with Ctrl+Shift+Enter), you must select the entire array range before editing, or Excel will throw a "You can't change part of an array" error. The exact steps depend on your Excel version and whether the array is dynamic or legacy.
What You'll Need
- Excel 365, Excel 2021, or Excel 2019 (steps for older versions are noted where they differ).
- A worksheet containing an array formula or a spilled array.
- Basic familiarity with the formula bar and cell selection.
Step-by-Step
- Identify the array type. Click any cell inside the array. Look at the formula bar: if the formula is enclosed in curly braces
{ }, it is a legacy array formula. If the formula appears without braces and the cells have a blue outline when selected, it is a dynamic array that spills. This distinction determines how you edit it. - For a dynamic array, edit the source cell. Select the top-left cell of the spilled range (the one containing the actual formula). Make your changes directly in the formula bar, then press Enter. The array will recalculate and spill to the new size automatically. If you try to edit a cell that is part of the spill but not the source, Excel will show a #SPILL! error or block the edit—always edit the source cell.
- For a legacy array, select the entire range first. Click the first cell of the array, then hold Shift and click the last cell, or drag to select the whole block. The formula bar will show the formula with braces. Press F2 to enter edit mode, make your changes, then press Ctrl+Shift+Enter to confirm. Excel will update the array across the selected range.
- To change the size of a legacy array, you must delete and re-enter it. Select the entire array range, press Delete to clear it, then select the new range (which can be larger or smaller), type the formula, and press Ctrl+Shift+Enter. You cannot resize a legacy array by dragging the fill handle.
- To convert a legacy array to a dynamic array (Excel 365 only), select the entire array range, press Ctrl+C, then press Esc. Click the top-left cell of the range, press Delete, then paste the formula back with Ctrl+V and press Enter. Excel may automatically convert it to a dynamic array if the formula supports spilling. If not, you can rewrite the formula using dynamic array functions like FILTER, SORT, or UNIQUE.
- To change a single value inside an array constant, edit the formula in the formula bar. For example, if the formula is
={1,2,3;4,5,6}, you can change a number directly. Press Enter (or Ctrl+Shift+Enter for legacy) to commit. - To remove an array, select the entire array range (for legacy) or the source cell (for dynamic), then press Delete. For dynamic arrays, deleting the source cell clears the entire spill. For legacy arrays, you must select the whole range before pressing Delete, otherwise Excel will warn you.
Menu labels and dialog wording can differ slightly by Excel version, device, and region. The steps above apply to Excel for Windows and Mac; Excel for the web supports dynamic arrays but has limited legacy array editing.
Common Mistakes
- Editing a single cell of a legacy array. Excel blocks this with the error "You can't change part of an array." Always select the full range first.
- Forgetting Ctrl+Shift+Enter for legacy arrays. If you just press Enter, Excel may treat the formula as a normal formula and return only the first result, or produce a #VALUE! error.
- Typing over a spilled range in a dynamic array. If you type in a cell that is part of a spill (not the source), Excel returns a #SPILL! error because the spill range is blocked. Clear the blocking cell or edit the source formula.
- Assuming all arrays are dynamic. Workbooks created in older Excel versions may contain legacy arrays that behave differently. Check for braces in the formula bar.
- Deleting only part of a legacy array. Pressing Delete on a single cell does nothing; you must select the whole array range.
Tips
- Use the Name Box (left of the formula bar) to quickly select an array range: type the range address and press Enter.
- To see which cells are part of an array, select any cell in it and press Ctrl+/ (Windows) or Command+/ (Mac) to select the entire array.
- Dynamic arrays spill automatically; you can reference the spill range with the
#operator (e.g.,A1#) in other formulas. - If you need to edit a legacy array frequently, consider rewriting it with dynamic array functions to avoid the Ctrl+Shift+Enter workflow.
- Before making bulk changes, save a copy of your workbook—array edits can be tricky to undo if you overwrite multiple cells.
Troubleshooting
- "You can't change part of an array" error: You tried to edit a single cell of a legacy array. Select the entire array range (Ctrl+/) and then edit.
- #SPILL! error: The dynamic array formula is trying to spill into cells that are not empty. Clear the blocking cells or move the formula to an empty area.
- Formula returns only one value: For legacy arrays, you may have forgotten Ctrl+Shift+Enter. Re-enter the formula with the correct key combination.
- Array formula won't accept changes: Ensure you are in edit mode (press F2) and that the entire array range is selected before typing.
- Cannot delete an array: For legacy arrays, select the whole range first; for dynamic arrays, delete the source cell. If the sheet is protected, unprotect it via Review > Unprotect Sheet.
- After conversion, formulas break: Some legacy array formulas rely on implicit intersection and may not work as dynamic arrays. Rewrite them using explicit functions like INDEX or FILTER.
Frequently Asked Questions
How do I know if my formula is an array formula?
Select the cell and look at the formula bar. If the formula is surrounded by curly braces { }, it is a legacy array formula. Dynamic arrays do not show braces; instead, they spill into adjacent cells with a blue outline when selected.
Can I edit just one cell of an array?
For legacy arrays, no—you must edit the entire array range at once. For dynamic arrays, you can edit the source cell (top-left), and the spill will update. You cannot edit a non-source cell of a spill without causing a #SPILL! error.
Why does Excel say "You can't change part of an array"?
This happens when you try to edit, delete, or format a single cell within a legacy array. Select the entire array range first (Ctrl+/), then make your change.
How do I resize a legacy array?
You cannot resize it directly. Delete the entire array, select the new range, re-enter the formula, and press Ctrl+Shift+Enter.
Can I convert a legacy array to a dynamic array?
In Excel 365, you can often convert by copying the formula, clearing the array, and pasting it back as a normal formula (press Enter). If the formula uses functions that don't spill, you may need to rewrite it with dynamic array functions.
What is the #SPILL! error and how do I fix it?
#SPILL! means a dynamic array formula cannot expand because one or more cells in the spill range are not empty. Clear those cells or move the formula to an empty area.