REDUCE(initial_value, array_or_range, LAMBDA)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
initial_value:
The starting value for the reduction process. This can be a number, text, or any other data type that you want to begin with.
array_or_range:
The array or range of cells that you want to process through the reduction operation. This is the collection of values that will be evaluated and combined.
LAMBDA:
A custom function defined using the LAMBDA syntax that takes at least two parameters: the accumulator (the current value being reduced) and the current item from the array or range. This function specifies how to combine these two values during the reduction process.
The REDUCE function in Google Sheets is a powerful tool used to apply a function across a range or array, aggregating the results into a single value. It is particularly useful for performing calculations that require combining multiple values, such as summing, multiplying, or concatenating.
In simpler terms, REDUCE allows you to take a list of values and apply a specific operation to them, ultimately producing a single output based on the defined function.
Imagine you are managing a list of sales data for different products:
| ProductID | Quantity | Price |
|---|---|---|
| 101 | 3 | 25.00 |
| 102 | 5 | 30.00 |
| 103 | 2 | 15.00 |
You want to calculate the total revenue generated from all products sold.
To achieve this, you would use the REDUCE function as follows:
=REDUCE(0, SalesData!B2:B4, LAMBDA(total, quantity, total + (quantity * INDEX(SalesData!C2:C4, ROW() - 1))))In this formula:
0 is the initial value for the total revenue.SalesData!B2:B4 is the range of quantities sold.LAMBDA(total, quantity, total + (quantity * INDEX(SalesData!C2:C4, ROW() - 1))) defines the operation to be performed: multiplying the quantity by the corresponding price and adding it to the total.When you apply the REDUCE formula to the Sales Data Table, the output would be the total revenue:
| Total Revenue |
|---|
| 195.00 |
This value represents the total revenue generated from all products sold based on the quantities and prices provided.
REDUCE is beneficial because it simplifies the process of aggregating data in Google Sheets. It allows for the application of custom functions to ranges, enabling complex calculations without the need for additional helper columns. This makes your spreadsheets cleaner and more efficient.
REDUCE is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data analysis and reporting capabilities.
Happy spreadsheeting!
You have a list of sales transactions in Column A and their corresponding amounts in Column B. Use the REDUCE function to calculate the total sales amount by summing up all values in Column B, providing a quick overview of total sales performance.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.