How ARRAYFORMULA works
Syntax
=ARRAYFORMULA(formula_with_ranges)formula_with_ranges- A normal formula where single cells are replaced with ranges, like B2:B instead of B2.
Example
New form responses keep arriving with a price in C and quantity in D. You want the total in E for every row, now and in future.
=ARRAYFORMULA(IF(C2:C="", "", C2:C*D2:D))One formula in E2 fills the whole column, and the IF keeps empty rows blank.
Common mistakes
- Leaving out the IF for blank rows, so the column fills with zeros to the bottom of the sheet.
- Typing into cells below the formula, which breaks it with a #REF! error.
- Using it in Excel, where it doesn't exist. Excel 365 spills ranges automatically without it.
Questions people ask
Is there a shortcut?
Press Ctrl+Shift+Enter while editing a formula in Sheets and it wraps it in ARRAYFORMULA.
Practice it above: type the formula in the formula bar and press Enter to check.