Forum Discussion
joelb95
Oct 22, 2024Brass Contributor
Excel Labs Array Module - What are your thoughts?
Sorry for what will seem like a code dump, but I'm curious if any of you have tried to create similar modules or if you have any comments/wisdom to share about the current incarnation of my module. ...
SergeiBaklan
Oct 23, 2024Diamond Contributor
Without playing with samples it's hard to comment concrete functions. First in mind, perhaps we may avoid MAP and FILTER in some cases, they are costly from performance point of view. For example,
replaceBlankCells =
LAMBDA(
array,
[replacement_value],
LET(
repl, IF(ISOMITTED(replacement_value), "", replacement_value),
IF( ISBLANK(array), repl, array)
)
);
For some could be variants which are bit easier in maintenance, at least from my point of view. e.g.
sliceCols =
LAMBDA(
original_array,
no_columns_to_drop,
[no_of_columns_to_take],
[no_columns_to_drop_from_end],
LET(
n, COLUMNS(original_array),
start, no_columns_to_drop + 1,
cols, MIN(no_of_columns_to_take, n - start + 1) -
no_columns_to_drop_from_end,
CHOOSECOLS(original_array, SEQUENCE(,cols,start))
)
);
Anyway, set of functions could be useful, thank you for sharing.