<< Go back to all functions

REDUCE

The REDUCE function in Google Sheets is used to reduce an array to an accumulated result by applying a LAMBDA function to each value. This is a powerful tool for performing complex calculations and aggregating data. Check out our detailed guide to learn how to use the REDUCE function effectively.

Function Syntax and Parameters

Syntax: REDUCE(initial_value, array_or_range, LAMBDA)

Parameters:

  • initial_value: The value to be used as the initial starting point for the reduction.
  • array_or_range: The array or range of values to be reduced.
  • LAMBDA: The function that will be applied to each value in the array or range.

Step-by-Step Tutorial

  1. Using REDUCE with an array of numbers:

    • Example: =REDUCE(0, {1, 2, 3, 4, 5}, LAMBDA(x, y, x + y))
    • Result: 15
  2. Using REDUCE with a range of cells:

    • Example: If A1:A5 has the values 10, 20, 30, 40, 50, then =REDUCE(0, A1:A5, LAMBDA(x, y, x + y)) will return 150.

Use Cases and Scenarios

  1. Summing Values: Add up a series of numbers or values.
  2. Product Calculations: Multiply a range of values together.
  3. Finding the Longest or Shortest String: Determine the longest or shortest string from a list of values.

Related Functions

  • SUM: Calculate the sum of a range of numbers or cells.
  • PRODUCT: Multiply a range of numbers together.
  • MAX: Find the largest value in a set.

Related Articles