Description
Apply a Lambda function to each value in scan arrray and return results.
NOTE
- The function will return a #VALUE! when you providing an invalid Lambda function. (Common error)
- The initial_value can be omitted, zero, an empty string, or any array..
If omitted, the value is set to the first element from souce array.
Syntax
Copied!=SCAN([initial_value], array, LAMBDA(accumulator, source, body))
EXAMPLE
Copied!//𝘶𝘴𝘦 𝘸𝘪𝘵𝘩 𝘯𝘢𝘵𝘪𝘷𝘦 𝘭𝘢𝘮𝘣𝘥𝘢 𝘰𝘳 𝘯𝘢𝘮𝘦𝘥 𝘭𝘢𝘮𝘣𝘥𝘢 𝘧𝘶𝘯𝘤𝘵𝘪𝘰𝘯 =SCAN(2, A1:A5, SUM) //𝘤𝘶𝘮𝘶𝘭𝘢𝘵𝘪𝘷𝘦 𝘴𝘤𝘢𝘯 𝘢𝘤𝘤𝘰𝘳𝘥𝘪𝘯𝘨 𝘵𝘰 𝘵𝘩𝘦 𝘦𝘹𝘱𝘳𝘦𝘴𝘴𝘪𝘰𝘯 𝘢+2*𝘣 ------------------------ 1 1 + 2 * 2 = 5 5 + 2 * 3 = 11 11 + 2 * 4 = 19 19 + 2 * 5 = 29 ------------------------ =SCAN(, SEQUENCE(5), LAMBDA(a, b, a+2*b))