Google Sheets: Calculate New Rows Automatically with ARRAYFORMULA

Use one ARRAYFORMULA in Google Sheets to calculate line totals for existing and newly added fictional orders. Includes an input CSV, exact formula, blocked-output check, and $96 reconciliation.

Google SheetsFictional practice dataEnglish captions
Start with a practice file

Try the example, then check the result.

Download the fictional material and follow the steps below. The video uses English illustrative diagrams; it does not present a live app recording. Product controls may vary by version.

Check the answer before applying the method to your own data. How we review guides ↗

Video walkthrough

Watch the complete lesson.

The video uses English illustrative diagrams; it does not present a live app recording. English captions. Product menus may differ in your account.

When new orders arrive, a copied line-total formula may stop at the last old row. This practice uses one ARRAYFORMULA in D2 to calculate existing rows and a newly appended row. Download the fictional CSV and answer check.

1. Import the source rows

Import the CSV into a new Google Sheet with a United States spreadsheet locale. Check that A1:C1 reads Order ID, Quantity, Unit price. The three initial rows are:

RowOrder IDQuantityUnit priceExpected line total
2A-1012$12$24
3A-1023$7$21
4A-1031$15$15

Swipe or scroll sideways to see every table column →

Enter Line total in D1. Leave D2 downward empty. A typed value or older copied formula in this output range can block the array result.

2. Enter the formula once

In D2, enter this exact formula:

=ARRAYFORMULA(IF(B2:B="","",B2:B*C2:C))

The IF returns an empty display for rows with no quantity; otherwise it multiplies quantity by unit price. Google's ARRAYFORMULA reference documents multirow results. The comma argument separators shown here are for a US-locale sheet. In another locale, check the local function separator rather than blindly changing the data.

Expected results: D2=24, D3=21, D4=15. Their sum is $60. The source CSV contains only A–C; these D values are the expected outcome, not prefilled totals.

3. Append a row and check automatic fill

Enter A-104 in A5, 4 in B5, and 9 in C5. Do not type into D5. The original formula in D2 should now display 36 in D5. The four line totals are 24 + 21 + 15 + 36 = 96.

If the result does not appear, inspect the formula letters and ranges, then look for content somewhere in D2 downward blocking expansion. Remove only the stray output-cell value. Do not clear the input quantities or prices.

Common questions

Where does the formula live? In D2 only. The cells below are output space, not separate formula copies.

What if Quantity is blank? The formula displays blank for that row. This example assumes a filled Quantity also has a valid numeric Unit price; inspect missing or text prices separately.

Why not use a shorter fixed range? B2:B and C2:C can cover rows you add later. The benefit shown here is verified by the fourth fictional row, not by a claim about every future data source.

Sources and visual evidence

Google's ARRAYFORMULA and formula references were checked 13 October 2026. The exact formula was tested in a private Sheet using these same fictional row values; the fourth row calculated automatically. The companion video uses illustrative diagrams based on the downloadable CSV. The blocked-output example was not separately tested in the app, and no app capture is included.

Take the example with you

Practice downloads.

The exercise files contain invented information. Save a local copy before editing.

Keep exploringBrowse published workshop guides