Skip to content

Instantly share code, notes, and snippets.

@matthews-p
Created November 27, 2024 18:00
Show Gist options
  • Save matthews-p/807086a0b9f2cc0a8faf971adc90d7a8 to your computer and use it in GitHub Desktop.
Save matthews-p/807086a0b9f2cc0a8faf971adc90d7a8 to your computer and use it in GitHub Desktop.
ConcatRowsFormat
/** ConcatRowsFormat */
/*
FUNCTION NAME: ConcatRowsFormat
DESCRIPTION: For a rectangular array (including table refs), returns
a dynamic array 1 column wide and n rows tall, concatenating the
values from each row and applying the specified number formats
to the values from each column
ARGS:
rng: The source range to be concatenated
format: 1-row by n-column array of number formats to apply
delim: The delimiter to be used
skipblanks: In each row's concatenation, TRUE skips blank
values and FALSE includes blank values
EXAMPLE:
=ConcatRowsFormat(MyTable[#All],OFFSET(MyTable[#Headers],-2,0),"|",FALSE)
*/
ConcatRowsFormat = LAMBDA(
rng,
format,
delim,
skipblanks,
BYROW(
rng,
LAMBDA(
r,
TEXTJOIN(
delim,
skipblanks,
TEXT(
r,
format
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment