Last active
November 29, 2024 19:42
-
-
Save matthews-p/43f85f18c8dff02e4c8bd7eea59ea1fa to your computer and use it in GitHub Desktop.
DistinctList
This file contains hidden or 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
/** DistinctList */ | |
/* | |
FUNCTION NAME: DistinctList | |
DESCRIPTION: Given a n-row by 1-column range of concatenated text, | |
returns a n-row by 1-column array of the unique values. Not | |
sorted (use DistinctListSort to get sorted list) | |
ARGS: | |
rng: Range holding original values | |
delim: Delimiter used to split the concatenated strings | |
col: Column index you want returned (1st column = 1) | |
EXAMPLE: | |
=DistinctList(A1:A1000,"|",4) | |
*/ | |
DistinctList = LAMBDA( | |
rng, | |
delim, | |
col, | |
UNIQUE( | |
BYROW( | |
rng, | |
LAMBDA( | |
r, | |
INDEX( | |
TEXTSPLIT( | |
r, | |
delim | |
), | |
col | |
) | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment