Forum Discussion
phuiyee
Jan 16, 2026Copper Contributor
Random Contractor Selection List
Hi, I would like to set up an automated random contractor list for tender purpose - is this possible? For example, I have Contractor 1 - Contractor 10, I would like to choose 2 contractors for each ...
PeterBartholomew1
Jan 17, 2026Silver Contributor
I have attempted to use a pseudo-random number generator that I had on file from Lori Miller. The advantage of this is that the values are not volatile so it is possible to add contracts without reassigning existing tender invitations.
My worksheet formula is
= INVITEDλ(contractorLst, COUNTA(Contracts))
where
INVITEDλ
= LAMBDA(contractors,n,
LET(
rand, WRAPROWS(PseudoRandλ(2*n, seed), 2),
m, COUNTA(contractors),
selection1, 1 + INT( m * CHOOSECOLS(rand, 1)),
selection2, 1 + INT((m-1) * CHOOSECOLS(rand, 2)),
selections, HSTACK(selection1, selection2 + (selection2>=selection1)),
invited, INDEX(contractorLst, selections),
invited
)
);The random number generator derived from Lori is
PseudoRandλ
= LAMBDA(length, [seed0],
// Written by Lori Miller
LET(
seed, IF(ISOMITTED(seed0), 123456789, seed0),
case, SEQUENCE(length, , , 0) * {13, -17, 5},
rand, SCAN(seed, case, LAMBDA(s, i, BITXOR(s, BITAND(BITLSHIFT(s, i), 2 ^ 32 - 1)))),
TAKE(rand,,-1) / (2^32)
)
);