-
-
Save ncalm/e9c1b7f6ffa5f5ffbf347e956bac4b2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
formula | |
=LET( | |
nums, SEQUENCE(10,,,RAND()*10), | |
data, SCAN( | |
0, | |
nums, | |
LAMBDA(a, v, | |
LET( | |
//get the value from the current row of the array | |
current, INDEX(nums, v, 1), | |
//get the value from the previous row of the array | |
previous, INDEX(nums, v - 1, 1), | |
//if nums-1 is zero, previous is the entire array, so use a default instead | |
//in this example, I've used zero as the default | |
previous_adj, IF(ROWS(previous) > 1, 0, previous), | |
//example calculation involving a, current and previous | |
a + ABS(current - previous_adj) | |
) | |
) | |
), | |
data | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment