Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value.
פונקציה זו פועלת ב-Google Sheets בדיוק כמו ב-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.