Created
August 10, 2022 19:35
-
-
Save ncalm/e5c7e44bd5db56e03a8c5e8a5035131f to your computer and use it in GitHub Desktop.
This Excel Lambda namepace contains several functions for working with lists
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
ROW = LAMBDA(row, | |
LAMBDA(array,INDEX(array,row,)) | |
); | |
/* | |
Gets the first row from a list | |
*/ | |
FIRST = LAMBDA(array, | |
list.ROW(1)(array) | |
); | |
/* | |
Gets the last row from a list | |
*/ | |
LAST = LAMBDA(array, | |
list.ROW(ROWS(array))(array) | |
); | |
/* | |
Returns TRUE if the item is in the array | |
*/ | |
CONTAINS = LAMBDA(item, | |
LAMBDA(array,NOT(ISERROR(XMATCH(item,array)))) | |
); | |
/* | |
Rolls the list into a CSV or similar using the given delimiter | |
*/ | |
JOIN = LAMBDA([delimiter], | |
LET( | |
delim,IF(ISOMITTED(delimiter),", ",delimiter), | |
LAMBDA(array, | |
TEXTJOIN(delim, FALSE, array) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment