How to Use Google Sheets’ ARRAYFORMULA Function (Versus Excel’s Array Formulas)

How to Use Google Sheets’ ARRAYFORMULA Function (Versus Excel’s Array Formulas)

Google Sheets’ ARRAYFORMULA function and Excel’s array formulas are both powerful tools that allow users to perform operations on entire ranges of data rather than processing each cell individually. While both functions are designed to simplify and automate tasks across multiple cells, they have minor differences in syntax. This post will explore these differences, compare the two, and provide practical examples using a retail sales dataset.

What is the ARRAYFORMULA Function?

The ARRAYFORMULA function in Google Sheets allows you to apply a formula to an entire range of data, automatically expanding the result to cover multiple rows or columns. This is especially useful when you want to perform the same calculation across an entire column without manually dragging the formula down.

Syntax:

=ARRAYFORMULA(formula_range)
  • formula_range: The range or operation you want to apply the formula to.

What is an Array Formula in Excel?

Excel’s array formulas allow you to perform operations on multiple values in a range of cells. In modern versions of Excel, dynamic arrays automatically handle these operations, making it easier to work with ranges of data without needing special syntax or keystrokes.

Syntax:

=FORMULA(array1, array2, ...)
  • FORMULA: The operation or function you wish to apply across the range.
  • array1, array2, …: The ranges or values that make up the array.

Example: Using ARRAYFORMULA vs. Excel’s Array Formulas with Retail Sales Data

Let’s consider a scenario where you have a dataset of retail sales, and you want to calculate the total sales for each product by multiplying the quantity sold by the price. We’ll compare how this is done using Google Sheets and Excel.

Sample Data:

Order ID Product Name Category Quantity Price Total Sales Order Date Customer Name
ORD001 Laptop Electronics 2 1200   2024-08-01 John Doe
ORD002 Headphones Accessories 5 200   2024-08-02 Jane Doe
ORD003 Smartphone Electronics 1 800   2024-08-03 Sam Roe
ORD004 Laptop Electronics 1 1200   2024-08-04 Chris Moe
ORD005 Keyboard Accessories 4 50   2024-08-05 Ann Poe

ARRAYFORMULA in Google Sheets

To calculate the Total Sales by multiplying Quantity by Price for each product in Google Sheets, you would place the ARRAYFORMULA function in the F2 cell, right below Total Sales header in column F.

Formula:

=ARRAYFORMULA(D2:D6 * E2:E6)

Array Formulas in Excel

To calculate the Total Sales by multiplying Quantity by Price for each product in Excel, you can now simply use a dynamic array formula. In modern versions of Excel (Excel 365 and Excel 2019), there’s no need to use Ctrl+Shift+Enter. Just enter the formula directly into cell F2.

Formula:

=D2:D6 * E2:E6

Explanation:

  • D2:D6 refers to the range of quantities.
  • E2:E6 refers to the range of prices.
  • The formula multiplies each value in D2:D6 by the corresponding value in E2:E6, automatically filling in the Total Sales column (F2:F6).

Expected Output:

  • The column “Total Sales” should now be populated with the product of the values in columns D and E. We should get the same result for both Google Sheets and Excel. 

Sample Result:

Order ID Product Name Category Quantity Price Total Sales Order Date Customer Name
ORD001 Laptop Electronics 2 1200 2400 2024-08-01 John Doe
ORD002 Headphones Accessories 5 200 1000 2024-08-02 Jane Doe
ORD003 Smartphone Electronics 1 800 800 2024-08-03 Sam Roe
ORD004 Laptop Electronics 1 1200 1200 2024-08-04 Chris Moe
ORD005 Keyboard Accessories 4 50 200 2024-08-05 Ann Poe

In summary, while both Google Sheets’ ARRAYFORMULA and Excel’s array formulas are designed to simplify operations across ranges of data, Google Sheets offers a slightly more intuitive approach. Excel’s recent updates with dynamic arrays bring it closer to this ease of use, eliminating the need for special keystrokes. Understanding these tools allows users to efficiently manage and analyze data across different platforms, enhancing productivity in any spreadsheet environment.

 
Image courtesy of rawpixel.com on Freepik.

Leave a Reply