Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value.
Эта функция в Google Таблицах работает так же, как в Excel — тот же синтаксис и аргументы.
SCAN(initial_value, array, lambda)The SCAN function iterates through an array and applies a LAMBDA function to each element, maintaining an accumulator that updates at every step. It returns an array of the same size as the input, showing the progression of the calculation.
=SCAN(0, {1, 2, 3}, LAMBDA(a, v, a+v))Результат: {1, 3, 6}
Calculates the running total of the array {1, 2, 3} starting from 0.
SCAN returns an array of all intermediate results, whereas REDUCE only returns the final accumulated value.