ARRAYFORMULA
Apply a formula to entire ranges instead of one cell at a time. One ARRAYFORMULA in a single cell replaces hundreds of dragged-down formulas — the foundation of maintainable Google Sheets workbooks.
⚡ Quick Answer
ARRAYFORMULA wraps a formula so it operates on entire ranges instead of single cells. The result spills across many cells from one anchor cell. It transforms non-array functions like IF, VLOOKUP, and arithmetic operators into array-aware versions.
Syntax
Arguments
| Argument | Type | Description |
|---|---|---|
| array_formulaRequired | Formula/Expression | A formula that operates on ranges (like A2:A100*B2:B100) or a function call that would normally work on single cells (like IF(A2:A100>0, "Yes", "No")). Just one argument — the entire formula to be array-wrapped. |
Keyboard shortcut
Instead of typing =ARRAYFORMULA( manually, use the shortcut. Type your formula normally with ranges (e.g., =A2:A26*B2:B26), then press:
Ctrl + Shift + Enter (Mac: Cmd + Shift + Enter)
Sheets automatically wraps the formula in ARRAYFORMULA(...). Press the same combination again to toggle it off.
Basic usage
When you need ARRAYFORMULA
| Function type | Needs ARRAYFORMULA? | Reason |
|---|---|---|
| Arithmetic operators (+, -, *, /) | ✓ Yes | Don't natively broadcast across ranges |
| Comparison operators (>, <, =) | ✓ Yes | Need wrapper to return array of TRUE/FALSE |
| IF, IFS, IFERROR, IFNA | ✓ Yes | Return only first result without wrapper |
| Text functions (LOWER, LEFT, LEN) | ✓ Yes | Designed for single cells |
| VLOOKUP, HLOOKUP, INDEX/MATCH | ✓ Yes | Single-value returns without wrapper |
| Date functions (DATEDIF, MONTH) | ✓ Yes | Designed for single cells |
| SUM, COUNT, AVG, MAX, MIN | ✗ No | Already array-aware |
| FILTER, SORT, UNIQUE, QUERY | ✗ No | Return arrays natively |
| SUMIF, COUNTIF | △ Optional | Native for aggregating; wrap only for per-row aggregates |
Common patterns
To include a header on the output: =ARRAYFORMULA(IF(ROW(A2:A100)=2, "Header", IF(A2:A100="", "", B2:B100*C2:C100))). The nested IFs handle the header row, empty rows, and calculated rows separately.
Common errors
| Error | Cause & fix |
|---|---|
#REF! |
Spill area contains data. Clear the cells below your formula so it can spill freely. |
#VALUE! |
Ranges have different sizes. A2:A10 * B2:B20 fails — match dimensions. |
| Only one value returned | Passed single cells (A2) instead of ranges (A2:A100). Use ranges throughout. |
| Empty rows filled with zeros | Arithmetic treats blanks as 0. Wrap with IF(A2:A100="", "", ...). |
| "Result was not automatically expanded" | Not enough blank rows below. Add rows or shorten the range. |
📚 Want the complete deep dive?
The full pillar guide covers all 6 patterns in depth, the header-row trick, Excel dynamic arrays comparison, performance tips, and includes a free companion workbook.
Related functions
Frequently asked questions
Does ARRAYFORMULA work in Microsoft Excel?
No. ARRAYFORMULA is native to Google Sheets. Excel 365 achieves similar results with dynamic arrays where formulas automatically spill without needing a wrapper — =A2:A100*B2:B100 works directly. Older Excel versions used Ctrl+Shift+Enter array formulas which are closer in concept.
What's the keyboard shortcut for ARRAYFORMULA?
Ctrl + Shift + Enter (or Cmd + Shift + Enter on Mac) automatically wraps your formula. Toggles on and off if pressed on an already-wrapped formula.
Which functions do NOT need ARRAYFORMULA?
Aggregations (SUM, COUNT, AVG, MAX, MIN) and array-native functions (FILTER, SORT, UNIQUE, QUERY) don't need it — they already handle ranges. Wrapping them usually has no effect. Wrapping is needed for arithmetic operators, IF, VLOOKUP, and functions designed for single cells.
Is ARRAYFORMULA slower than dragging?
For small ranges, no difference. For medium-to-large ranges, ARRAYFORMULA is often faster because Sheets processes the range in one calculation pass. The bigger benefit is maintainability — one formula instead of thousands.
Can ARRAYFORMULA output spill into multiple columns?
Yes. If the inner formula returns multiple columns (like VLOOKUP with column array {2,3,4}), ARRAYFORMULA spills across both rows and columns from a single anchor cell.