ARRAYFORMULA in Google Sheets
Lets one formula work on whole ranges at once, so the result fills a whole column.
Syntax
ARRAYFORMULA(array_formula)- array_formula
- The formula that works on ranges, such as A2:A10*B2:B10.
Examples
D1=ARRAYFORMULA(A2:A4*B2:B4)
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Qty | Price | 10 | |
| 2 | 2 | 5 | 12 | |
| 3 | 3 | 4 | 7.5 | |
| 4 | 1 | 7.5 |
D1=ARRAYFORMULA(SUM(A2:A4*B2:B4))
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Qty | Price | 29.5 | |
| 2 | 2 | 5 | ||
| 3 | 3 | 4 | ||
| 4 | 1 | 7.5 |