Reduces an array to an accumulated value by applying a LAMBDA to each element.
تعمل هذه الدالة في Google Sheets كما تعمل في Excel تمامًا — بالصياغة والوسائط نفسها.
REDUCE(initial_value, array, lambda)The REDUCE function iterates through an array and applies a custom LAMBDA function to accumulate a single result. It maintains an accumulator that updates with each step, starting from the initial value provided.
=REDUCE(0, {1,2,3}, LAMBDA(a, b, a + b))النتيجة: 6
Sums the numbers in the array by starting at 0 and adding each element.
REDUCE returns only the final accumulated result, whereas SCAN returns an array of all intermediate values.