MeniPorat
"I've written some very useful LAMBDAS"
Hi Meni, I think you are ahead of me there! I have written some Lambda's that are just work-in-progress that form part of developing every modern Excel solution. For example
ORλ = LAMBDA(x,OR(x));
SUMλ = LAMBDA(x,SUM(x));
act as simple wrappers for aggregation function, allowing them to be used within a helper function such as
= FILTER(table, BYROW(operators=selected, ORλ), "Not found")
Such lambdas do not really need an exchange mechanism. Conversely
rebuiltArrayλ = LAMBDA(dᵥ,
LET(
nᵣ, ArrayRef1λ(),
nᵥ, PRODUCT(IF(dᵥ = 1, nᵣ, 1)),
nₓ, PRODUCT(IF(dᵥ = 2, nᵣ, 1)),
n₀, PRODUCT(IF(dᵥ = 0, nᵣ, 1)),
sᵥ, SCAN(1, IF(dᵥ = 1, nᵣ, 1), LAMBDA(s, n, n * s)) / nᵣ,
sₓ, SCAN(1, IF(dᵥ = 2, nᵣ, 1), LAMBDA(s, n, n * s)) / nᵣ,
s₀, SCAN(1, IF(dᵥ = 0, nᵣ, 1), LAMBDA(s, n, n * s)) / nᵣ,
rowIndices, IF(dᵥ = 1, 1 + MOD(QUOTIENT(SEQUENCE(nᵥ) - 1, +sᵥ), nᵣ), 0),
columnIndices, IF(
dᵥ = 2,
1 + MOD(QUOTIENT(SEQUENCE(nₓ) - 1, +sₓ), nᵣ),
0
),
reduceIndices, IF(
dᵥ = 0,
1 + MOD(QUOTIENT(SEQUENCE(n₀) - 1, +s₀), nᵣ),
0
),
MAKEARRAY(
nᵥ,
nₓ,
LAMBDA(r_, c_,
REDUCE(
0,
SEQUENCE(n₀),
LAMBDA(acc, i_,
acc +
ArrayRef1λ(
INDEX(rowIndices, r_, ) +
INDEX(columnIndices, c_, ) +
INDEX(reduceIndices, i_, )
)
)
)
)
)
)
);
which pivots a multidimensional array (with each dimension may be displayed vertically, horizontally or summed out) needs for more in the way of description and probably the accompanying workbook to demonstrate its usage.
Something else that might be of interest is an ability to scope Lambda function names to 'user' or 'corporate' templates (extending the present 'cell', 'sheet', 'workbook' scopes for naming) to facilitate local sharing without requiring the use of external platforms.