Last active
May 4, 2024 08:15
-
-
Save jimpea/e3ef74752d41a58df12ffe6fce718167 to your computer and use it in GitHub Desktop.
Excel Lambda function to convert an array to a list
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
FLATTEN = LAMBDA(array, | |
LET( | |
//name definitions | |
rows_, ROWS(array), | |
cols_, COLUMNS(array), | |
// index the zero-based array | |
seq_, SEQUENCE(rows_*cols_, 1, 0, 1), | |
// row and column indices | |
row_, INT(seq_/cols_), | |
col_, MOD(seq_, cols_), | |
// return | |
// get array cell by row and column index | |
INDEX(array, row_ + 1, col_ + 1))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment