Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 837
- Office Version
- 365
- Platform
- Windows
ARANDBETWEEN Returns an array of random integers between 2 numbers, with or without duplicates.
Excel Formula:
=LAMBDA(va, vb, [r], [c], [uq], [fm],
LET(
w, MAX(1, r),
l, MAX(1, c),
n, w * l,
x, FLOOR(MAX(va, vb), 1),
m, CEILING(MIN(va, vb), 1),
k, x - m + 1,
s, SEQUENCE(k, , m),
IF(
AND(uq, k < n),
NA(),
LET(y, IF(uq, SORTBY(s, RANDARRAY(k)), RANDARRAY(n, , m, x, 1)), z, INDEX(y, SEQUENCE(w, l)), IF(fm = "", z, TEXT(z, fm)))
)
)
)
Upvote
0