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.