Google Sheets Tips

ARRAYFORMULA in Google Sheets: how to use array formulas, with examples

ARRAYFORMULA makes one formula return a result for every row of a range. This guide covers the syntax, calculations across columns, IF, VLOOKUP, SUMIF and COUNTIF inside an array formula, open-ended ranges, the functions that do not expand, and the errors you will meet.

Google Sheets TipsVadym Kramarenko11 min read

ARRAYFORMULA in Google Sheets: how to use array formulas, with examples

ARRAYFORMULA makes a formula that normally works on one cell work on a whole range and return a result for every row. Instead of writing =B3*C3 and copying it down, you write one formula in the first cell:

=ARRAYFORMULA(B3:B11 * C3:C11)

The results fill the cells below. There is nothing to copy, and no row can end up with a different formula from the others.

You need Formula
Multiply two columns =ARRAYFORMULA(B3:B11 * C3:C11)
Join two columns as text =ARRAYFORMULA(B3:B12 & " - " & C3:C12)
A condition for every row =ARRAYFORMULA(IF(D3:D11 > 12000, D3:D11 * 0.1, 0))
Look up a whole list of keys =ARRAYFORMULA(VLOOKUP(F4:F7, B3:D11, 3, FALSE))
A total for each item of a list =ARRAYFORMULA(SUMIF(C3:C12, F3:F5, D3:D12))
Cover rows that are added later =ARRAYFORMULA(IF(B3:B = "", , B3:B * C3:C))

ARRAYFORMULA syntax

ARRAYFORMULA syntax

=ARRAYFORMULA(array_formula)

  • array_formula: a range, an expression that uses one or more ranges of the same size, or a function that returns more than one cell.

There are two ways to enter it. Type the function name yourself, or write the inner formula and press Ctrl+Shift+Enter (Cmd+Shift+Enter on a Mac): Sheets wraps the formula in ARRAYFORMULA for you.

Google Sheets with units sold in column B, price per unit in column C and the formula =ARRAYFORMULA(B3:B11 * C3:C11) in E3 filling the Total Sales column for nine rows

The formula sits in E3 only. E4 to E11 hold results, not formulas: you cannot edit them one by one, and if you type something into one of them, the array formula stops with a #REF! error because it has no room to expand.

Basic operations on columns

Basic operations on columns

Calculate across two columns

Any arithmetic works the same way as with single cells, with ranges in place of the cells:

=ARRAYFORMULA(B3:B11 + C3:C11)

The two ranges have to be the same size. Each row of the result is calculated from the cells of the same row.

Join columns as text

The ampersand joins text, and with ranges it joins row by row. With the campaign type in column B and the campaign name in column C:

=ARRAYFORMULA(B3:B12 & " - " & C3:C12)

Google Sheets with campaign types in column B, campaign identifiers in column C and the formula =ARRAYFORMULA(B3:B12 & “ - “ & C3:C12) in E3 returning values such as Email - Campaign A for each row

Multiply two ranges cell by cell

The ranges can have several columns. Each cell of the first range is combined with the cell in the same position of the second one. With sales for two regions in B3:C5 and the rates for the same regions in D3:E5:

=ARRAYFORMULA(B3:C5 * D3:E5)

Google Sheets with sales for two regions in B3:C5, commission rates in D3:E5 and the formula =ARRAYFORMULA(B3:C5 * D3:E5) in C8 returning a table of three rows and two columns of products

The result is a table of three rows and two columns. This is element-by-element multiplication; for matrix multiplication in the mathematical sense, Sheets has the MMULT function.

The Turning Point

OWOX Data Marts

See your first report built in real time. 15 minutes.

  1. Connect your data warehouse
  2. Pick your metrics
  3. Get a live Google Sheets report

In the time it takes to write a ticket. Then imagine never writing that ticket again.

Book a Demo

We'll use your actual use case

ARRAYFORMULA with other functions

ARRAYFORMULA with other functions

IF: a condition for every row

Inside ARRAYFORMULA, IF tests every row of a range and returns a result for each. To pay a 10% bonus on sales above 12,000 and nothing otherwise:

=ARRAYFORMULA(IF(D3:D11 > 12000, D3:D11 * 0.1, 0))

Google Sheets with employee sales in column D and the formula =ARRAYFORMULA(IF(D3:D11>12000, D3:D11*0.1, 0)) in F3 returning a bonus of 1800 for sales of 18000 and 0 for sales below 12000

IFs can be nested. This formula leaves the status empty when there is no task, and otherwise shows Completed or Pending depending on whether the completion date is filled in:

=ARRAYFORMULA(IF(B3:B11 <> "", IF(C3:C11 <> "", "Completed", "Pending"), ""))

Google Sheets with tasks in column B, completion dates in column C and a nested IF inside ARRAYFORMULA in E3 returning Completed for rows with a date and Pending for rows without one

AND and OR do not work per row. They reduce the whole range to a single TRUE or FALSE, so =ARRAYFORMULA(IF(AND(D3:D5 > 1000, D3:D5 < 2500), "yes", "no")) returns one value for the range. Multiply the conditions for AND and add them for OR:

=ARRAYFORMULA(IF((D3:D5 > 1000) * (D3:D5 < 2500), "yes", "no"))

VLOOKUP: look up a list of keys

VLOOKUP takes one search key. Inside ARRAYFORMULA it takes a range of keys and returns a result for each. With employee IDs in F4:F7 and the table in B3:D11:

=ARRAYFORMULA(IF(F4:F7 <> "", VLOOKUP(F4:F7, B3:D11, 3, FALSE), ""))

  • F4:F7: the IDs to look up.
  • B3:D11: the table; the IDs are in its first column.
  • 3: the column to return, the region.
  • IF(F4:F7 <> “”, …, “”): leaves the result empty where no ID is entered, instead of #N/A.

Google Sheets with an employee table in B3:D11, four IDs in F4:F7 and an ARRAYFORMULA with VLOOKUP in G4 returning the region for each ID

Change the index to 2 and the same formula returns the names:

=ARRAYFORMULA(IF(F11:F12 <> "", VLOOKUP(F11:F12, B3:D11, 2, FALSE), ""))

Google Sheets with two IDs in F11:F12 and an ARRAYFORMULA with VLOOKUP in G11 returning the employee names Lisa Davis and Mary Johnson

SUMIF: one total per item

SUMIF returns one total for one criterion. Give it a range of criteria inside ARRAYFORMULA and it returns one total for each of them. With sales reps in C3:C12, amounts in D3:D12 and three names in F3:F5:

=ARRAYFORMULA(SUMIF(C3:C12, F3:F5, D3:D12))

The formula returns three totals, one next to each name.

SUMIF takes one condition. To sum by two columns with it, join the columns and compare them with a joined criterion. This formula adds up revenue for North America in Q1:

=ARRAYFORMULA(SUMIF(D3:D11 & G3:G11, "North America" & "Q1", F3:F11))

  • D3:D11 & G3:G11: region and quarter joined row by row, for example North AmericaQ1.
  • “North America” & “Q1”: the criterion in the same joined form.
  • F3:F11: the revenue to add up.

Google Sheets with campaign data and the formula =ARRAYFORMULA(SUMIF(D3:D11 & G3:G11, “North America”&“Q1”, F3:F11)) in I3 returning 27500, the revenue of North America in Q1

ARRAYFORMULA is required here: without it the joined range is not evaluated row by row. For a single total with several conditions, SUMIFS is the simpler tool and needs no ARRAYFORMULA: =SUMIFS(F3:F11, D3:D11, "North America", G3:G11, "Q1").

SUMIFS does not expand. =ARRAYFORMULA(SUMIFS(D3:D12, C3:C12, F3:F5)) returns a single number, the total for the first criterion, with no error. For a column of totals use SUMIF as above.

COUNTIF: count several values at once

COUNTIF follows the same rule. With a list of criteria in curly braces it returns one count for each:

=ARRAYFORMULA(COUNTIF(B3:C5, {"Product A", "Product B"}))

Google Sheets with product names for two regions in B3:C5 and the formula =ARRAYFORMULA(COUNTIF(B3:C5, {“Product A”,“Product B”})) in E4 returning 2 for Product A and 4 for Product B

The range B3:C5 contains Product A twice and Product B four times, and the two counts appear side by side, because the criteria are written as a row. Separate them with a semicolon, {“Product A”; “Product B”}, to get the counts one under the other.

FILTER: no ARRAYFORMULA needed

FILTER already returns a range, so it works with or without ARRAYFORMULA around it. To return the rows where the category is Clothing and the region is North America:

=FILTER(C3:F11, (D3:D11 = "Clothing") * (E3:E11 = "North America"))

Google Sheets with a product table and a FILTER formula with two conditions multiplied together in C15, returning the two Clothing products sold in North America

The same goes for removing blanks from a list:

=FILTER(B3:B16, B3:B16 <> "")

Google Sheets with a column of product names with empty cells in column B and a FILTER formula in D3 returning the same list without the blanks

The screenshots show both formulas wrapped in ARRAYFORMULA; the result is the same. QUERY, UNIQUE, SORT and SEQUENCE also return ranges on their own.

CONCATENATE: everything into one cell

CONCATENATE does not work row by row. Inside ARRAYFORMULA it joins the whole range into a single cell:

=ARRAYFORMULA(CONCATENATE(" - " & C3:C11 & ": " & D3:D11 & CHAR(10)))

  • ” - “ & C3:C11 & “: “ & D3:D11: product name and description for each row.
  • CHAR(10): a line break after each row.

Google Sheets with product names in column C, descriptions in column D and an ARRAYFORMULA with CONCATENATE in F3 returning one cell that lists every product with its description on a separate line

That is useful for a summary cell. For one joined value per row, use the ampersand as in the campaign example above. More on joining text in the guide to CONCATENATE and the ampersand.

Cover rows that are added later

Cover rows that are added later

A range such as B3:B11 stops at row 11. To make the formula pick up new rows, leave the end of the range open and skip the empty rows:

=ARRAYFORMULA(IF(B3:B = "", , B3:B * C3:C))

  • B3:B and C3:C: from row 3 to the bottom of the sheet.
  • IF(B3:B = “”, , …): returns nothing for rows where column B is empty, so the column is not filled with zeros.

An open-ended formula is calculated for every row of the sheet, including the empty ones. On a sheet with tens of thousands of rows and several such columns, a closed range that is a little longer than the data is faster.

ARRAYFORMULA errors

ARRAYFORMULA errors

#REF!: the result has no room

⚠️ Error: #REF! with the message that the array result was not expanded because it would overwrite data.

✅ Solution: One of the cells the formula needs to fill is not empty. Clear the cells below and to the right of the formula.

A #REF! with “Unresolved sheet name” is a different problem: the formula points to a tab that does not exist or has been renamed.

Google Sheets with the formula =ARRAYFORMULA(Sheet8!B3) returning #REF! and the message Unresolved sheet name ‘Sheet8’

An error in one row only

⚠️ Error: One row of the result shows an error such as #NUM! or #DIV/0!, and the others are fine.

✅ Solution: The error belongs to that row’s data. A square root of a negative number returns #NUM!, a division by zero returns #DIV/0!. Fix the value, or wrap the calculation in IFERROR: =ARRAYFORMULA(IFERROR(SQRT(B3:B12), "")).

Google Sheets with the formula =ARRAYFORMULA(SQRT(B3:B12)) returning #NUM! for the value -3 with the message that the SQRT parameter is negative, and square roots for the other rows

#N/A: wrong number of arguments

⚠️ Error: #N/A with “Wrong number of arguments to ARRAYFORMULA”.

✅ Solution: The parentheses are empty or contain more than one argument. ARRAYFORMULA takes exactly one.

Google Sheets with the formula =ARRAYFORMULA( ) returning #N/A and the message Wrong number of arguments to ARRAYFORMULA, expected 1 arguments but got 0

Inside a lookup, #N/A has its usual meaning: the key was not found.

#ERROR!: the formula cannot be read

⚠️ Error: #ERROR! with “Formula parse error”.

✅ Solution: Look for a missing parenthesis, a missing quote or an operator with nothing after it.

Google Sheets with the formula =ARRAYFORMULA(Sheet8!B2:B22+Sheet8!E2:E22+) returning #ERROR! and the message Formula parse error because of the trailing plus sign

#VALUE! without ARRAYFORMULA

⚠️ Error: A formula with ranges, such as =SUM(D3:D12 * 2) or =LEN(C3:C5), returns #VALUE!.

✅ Solution: The function expects single values and received ranges. Wrap the formula in ARRAYFORMULA, or press Ctrl+Shift+Enter.

Only one result where a column was expected

⚠️ Error: The formula returns one value and no error.

✅ Solution: The function inside does not expand: AND, OR and SUMIFS reduce the range to one value. Replace AND and OR with multiplication and addition of conditions, and SUMIFS with SUMIF.

Related Google Sheets functions

Functions that are often used with or instead of ARRAYFORMULA, each with its own guide:

  • FILTER: Returns the rows that meet one or more conditions.
  • QUERY: Filters, sorts and summarizes a table with SQL-like syntax.
  • UNIQUE: Returns the distinct values of a range.
  • XLOOKUP: A lookup that can search in any direction.
  • INDEX and MATCH: A lookup built from two functions, for cases VLOOKUP does not cover.
  • Pivot tables: Summarize a table by category without formulas.
  • QUERY with UNIQUE: Combines SQL-like filtering with deduplication to return only the distinct rows that match a condition.
  • QUERY date filtering: Filters rows by a date or a date range inside a QUERY formula.

One formula per column is half the job

One formula per column is half the job

ARRAYFORMULA removes the copied formulas from a report. The other fragile part is the range it runs on. When the rows are pasted in from an export, the formula silently calculates whatever is there: last week’s rows that nobody replaced, a column that shifted by one, numbers that arrived as text.

The OWOX Data Marts extension for Google Sheets covers that half. A data analyst publishes a data mart (a table or an SQL query in your data warehouse) and makes it available for reports. In Sheets you open the extension, pick the data mart, tick the columns you want and run it. The rows land in a tab, ready for your formulas.

Google Sheets with the OWOX Data Marts extension open beside an ad spend table: the Unified Ad Spend data mart, nine of fourteen columns ticked and a Save & Run button – the rows in the sheet come from a governed data mart, not a pasted export

What changes for the person who maintains the sheet:

  • Refresh replaces re-export. Refresh current report in the extension menu re-runs the same pull, and a scheduled refresh keeps the tab current without anyone touching it.
  • The source is written on the sheet. The header cell of an imported tab carries a note with the data mart it came from, the time of the import and a link to the report.
  • No SQL and no warehouse access needed. The analyst decides which data marts and columns are available. You choose from that list.

The extension does not write or change the analyst’s SQL. The array formulas then run on rows that come from the same data mart on every refresh. The extension comes with the OWOX Cloud plans of OWOX Data Marts; spreadsheet reporting describes both ways data reaches a sheet.

Your New Normal

Turn your data into decisions.

Governed data marts give you the clean foundation ML needs to actually work.

  • No AI hallucinations
  • Analyst-governed definitions
  • Every number traces to SQL
Get started free

FAQ

Frequently Asked Questions

How to Use the ARRAYFORMULA Function in Google Sheets?

To use the ARRAYFORMULA function, start with =ARRAYFORMULA(), and inside the parentheses, enter the desired calculation or operation to apply it across a range of cells or data.

Is it Possible to Combine Multiple Array Formulas in Google Sheets, and If So, How?

Yes, you can combine multiple array formulas by nesting them within one another, allowing for more intricate and powerful calculations.

How Do Array Formulas Interact with Other Functions in Google Sheets?

Array formulas can be combined with various functions, such as SUM, AVERAGE, or VLOOKUP, to perform complex calculations and data manipulations.

Are There Any Limitations or Common Errors to Be Aware of When Using Array Formulas in Google Sheets?

Yes. The cells the result needs must be empty, otherwise the formula returns #REF!. AND, OR and SUMIFS do not expand inside ARRAYFORMULA and return a single value; use multiplication of conditions and SUMIF instead. An open-ended range such as B3:B is calculated for every row of the sheet, which slows down large files.

What Is an Array Formula in Google Sheets?

An array formula in Google Sheets is a single formula that can perform calculations or operations on multiple cells or an entire range, simplifying complex data tasks.

How Can I Troubleshoot Issues with My Array Formulas in Google Sheets?

Read the message in the cell. #REF! usually means the result has no room to expand, so clear the cells below the formula. #VALUE! on a formula with ranges means ARRAYFORMULA is missing. #ERROR! is a typing mistake such as a missing parenthesis. An error in a single row comes from that row's data and can be hidden with IFERROR.

How Do I Apply a Formula to a Single Cell in Google Sheets?

Type the formula with cell references, for example =B3*C3, and press Enter. No ARRAYFORMULA is needed. To turn it into an array formula later, replace the cells with ranges and press Ctrl+Shift+Enter.

What Is the Inside Content of an ARRAYFORMULA Function?

The inside content of an ARRAYFORMULA function typically includes the desired calculation or operation, enclosed within the function's parentheses.

Who wrote this

Vadym Kramarenko

Vadym Kramarenko · Growth Marketing Manager

Vadym Kramarenko is a Growth Marketing Manager at OWOX, where he drives user acquisition and product-led growth strategies. He hosts the OWOX podcast, interviewing analytics professionals about data-driven marketing, attribution, and reporting best practices. Vadym specializes in turning complex analytics concepts into practical, actionable marketing frameworks.