ARRAYFORMULA: total revenue without a helper column

Lesson 45 of 54

ARRAYFORMULA lets one formula in Google Sheets work on whole columns at once, so you don't have to copy it down every row.

In cell E2, write a formula that multiplies every Price by its Units and adds the results, using SUM and ARRAYFORMULA.

E2
ABCDE
1ItemPriceUnitsRevenue
2Mug840
3Shirt1525
4Cap1230

Type in the formula bar above and press Enter to check.

Skip

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.