How to Use Google Sheets’ Array Formulas for Batch Calculations (Versus Excel’s Dynamic Arrays)

How to Use Google Sheets' Array Formulas for Batch Calculations (Versus Excel's Dynamic Arrays)

Google Sheets’ array formulas and Excel’s dynamic arrays are powerful tools to perform batch calculations within a single formula. Array formulas make spreadsheet calculations more efficient by reducing the repetitive tasks for the same operation. This post will show the difference and the use of array formulas in Google Sheets and Excel through practical examples.

What is the Array Formula in Google Sheets?

Formulas that perform multiple calculations for a range of cells are known as array formulas. Array formulas perform batch calculations on multiple cells within one single formula. It returns single or multiple results based on the formula. It is useful to perform similar calculations across a range of cells. Google Sheets offers an ARRAYFORMULA function to perform batch calculations. By using this function, you can create array formulas.

To create an array formula in Google Sheets,

  1. Enter your desired usual formula in a cell.
  2. Next, wrap the formula with the ARRAYFORMULA function to perform batch calculations across multiple ranges of cells.

What is Dynamic Array in Excel?

Dynamic arrays automatically calculate the range of cells and return arrays of variable size into multiple cells. Excel’s dynamic arrays don’t require any additional function like ARAAYFORMULA to perform batch calculations. Dynamic arrays are available in Excel 365 and 2021.

Batch Calculations by Using Google Sheet’s Array Formulas and Excel’s Dynamic Arrays

To perform the batch calculation using array formula and dynamic array consider sample sales data. Suppose you want to calculate the sales commission (7%) based on the quantity of sold products.

Sample Dataset:

Employee

Name

Date Product Category Quantity Price Commission

(7%) on Sales

Mike Jonas 01/01/2024 Laptop Electronics 4 $2,200.00  
Steve Smith 03/01/2024 Smartphone Electronics 5 $800.00  
Lara Jonson 05/01/2024 TV Electronics 3 $1,500.00  
Emily Copper 07/01/2024 Headphones Electronics 6 $100.00  
Erin Doe 10/01/2024 Book Books 8 $200.00  
Sarah Lee 15/01/2024 Chair Furniture 9 $200.00  
Lio Green 20/01/2024 Table Furniture 4 $300.00  
Phobe Gomez 25/01/2024 Jacket Clothing 12 $80.00  
Elian Swift 30/01/2024 Shoes Clothing 7 $120.00  

Array Formula in Google Sheets:

To calculate the sales commission based on a fixed percentage you will need to use the IF function in Google Sheet, but it doesn’t create an array formula. To make it an array formula you will need to use the ARRAYFORMULA function. Then, it will perform batch calculations to calculate the sales commission of all employees. Select cell G2 and insert the following formula.

Formula:

=ARRAYFORMULA(IF(E2:E10 >= 3, F2:F10 * 0.07, “No Commission”))

Explanation: IF formula checks the quantity of sold product, if it’s greater than and equal to 3, it multiplies the corresponding price of that product by 0.07 (7%). Otherwise, it returns no commission. The ARRAYFORMULA automatically calculates the commission of all employees with a single formula.

  • E2:E10 >= 3: This part is the logical expression to check whether each value is greater than or equal to 3 or not.
  • F2:F10 * 0.07: If any value of column E is greater than or equal to 3 this part will multiply the corresponding value of column F by the commission percentage of 0.07.
  •  “No Commission”: If any value of column E is less than 3 then the formula will return No Commission on those cells.
  • ARRAYFORMULA: This function is applied to the IF statement to perform batch calculations on the entire range of E2:E10 and F2:F10 cells to return the commission of all employees simultaneously. 

Dynamic Arrays in Excel:

To get the commission on sales of each employee you can use the IF function in Excel. It will create an array formula to perform batch calculations. Select cell G2 in Excel and insert the following formula.

Formula:

=IF(E2:E10 >= 3, F2:F10 * 0.07, “No Commission”)

Explanation: IF formula checks the quantity of sold product, if it’s greater than and equal to 3, it multiplies the corresponding value of product price by the sale commission 0.07 (7%). Otherwise, it returns no commission.

Output:

Employee

Name

Date Product Category Quantity Price Commission

(7%) on Sales

Mike Jonas 01/01/2024 Laptop Electronics 4 $2,200.00 $154.00
Steve Smith 03/01/2024 Smartphone Electronics 5 $800.00 $56.00
Lara Jonson 05/01/2024 TV Electronics 3 $1,500.00 $105.00
Emily Copper 07/01/2024 Headphones Electronics 1 $100.00 No Commission
Erin Doe 10/01/2024 Book Books 8 $200.00 $14.00
Sarah Lee 15/01/2024 Chair Furniture 2 $200.00 No Commission
Lio Green 20/01/2024 Table Furniture 4 $300.00 $21.00
Phobe Gomez 25/01/2024 Jacket Clothing 12 $80.00 $5.60
Elian Swift 30/01/2024 Shoes Clothing 7 $120.00 $8.40

Conclusion

Array formulas are flexible and powerful in terms of batch calculations for both Google Sheets and Excel. Google Sheets requires the ARRAYFORMULA function to create an array formula. Though some functions automatically perform batch calculations such as FILTER, SORT, UNIQUE, IMPORTRANGE, QUERY, etc. Excel’s dynamic arrays are more useful and easier to use in the recent Excel versions. It automatically performs batch calculations and spills result in multiple cells without requiring any extra function. Both formulas are efficient and help to avoid repetitive tasks. Mastering both array formulas will help you to process your data more efficiently.

Leave a Reply

Your email address will not be published. Required fields are marked *