Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- Windows
ARANDOM creates a random array of "n" rows using elements of another array "a"
Idea credited to Rico, different approach.
Other functions on minisheet ACOMBINE , ADATE , ATEXTJOIN
Idea credited to Rico, different approach.
Other functions on minisheet ACOMBINE , ADATE , ATEXTJOIN
Excel Formula:
=LAMBDA(a,n,
LET(c,COLUMNS(a),
x,INDEX(a,INT(RANDARRAY(n,c)*MMULT(SEQUENCE(,ROWS(a))^0,--(a<>"")))+1,SEQUENCE(,c)),
IF(x="null","",x)
)
)
LAMBDA 7.0.xlsx | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | |||
1 | 1st name | Mid name | Lst Name | 2nd Lst Name | shuffle | n | Date | ID-nr_Name | Product | Package | Region | shuffle | y | |||||||||||
2 | =ADATE(RANDARRAY(40,,"1-jan-20","30-05-21",1),"f",) | |||||||||||||||||||||||
3 | sample | =IF(G1="y",ARANDOM(A4:D23,20),F4#) | =ATEXTJOIN(F4#,"ID-"&SEQUENCE(ROWS(F4#))&"_",," ") | =IF(R1="y",ARANDOM(K4:O43,45),Q4#) | ||||||||||||||||||||
4 | Mel | null | Dawkins | Mattei | Theodore | Kriger | Ryburn | 01-04-20 | ID-1_Theodore Kriger Ryburn | Quad | 3 | West | 01-01-21 | ID-19_Houston Myron Enderle | Yanaki | 18 | South | |||||||
5 | Winford | null | Filer | Speth | Antione | Myron | Scheidler | Fogle | 01-04-21 | ID-2_Antione Myron Scheidler Fogle | Majestic | 6 | South | 01-06-20 | ID-8_Rey Myron Mcglothlin Mattei | Sunset | 6 | Canada | ||||||
6 | Miguel | null | Valtierra | Yale | Antione | Grinnell | 01-01-21 | ID-3_Antione Grinnell | Yanaki | 12 | MidWest | 01-04-20 | ID-13_Rey Jamel Dawkins Fogle | Crested | 6 | NorthWest | ||||||||
7 | Hollis | null | Shelton | Levison | Freddie | Jere | Otten | Levison | 01-07-20 | ID-4_Freddie Jere Otten Levison | Crested | 18 | Canada | 01-09-20 | ID-14_Houston Grinnell Levison | Gigi | 12 | South | ||||||
8 | Davis | null | Pasquariello | Fogle | Mel | Jere | Scheidler | 01-01-20 | ID-5_Mel Jere Scheidler | Sunset | Mexico | 01-03-20 | ID-17_Rudolf Bradly Garth | Crested | 12 | East | ||||||||
9 | Houston | null | Grinnell | Ryburn | Jesus | Pasquariello | Ryburn | 01-03-20 | ID-6_Jesus Pasquariello Ryburn | Gigi | NorthWest | 01-12-20 | ID-3_Antione Grinnell | Yanaki | 12 | East | ||||||||
10 | Antione | Jarrod | Dechant | Hoge | Houston | Arnoldo | Ybarbo | 01-08-20 | ID-7_Houston Arnoldo Ybarbo | East | 01-04-21 | ID-5_Mel Jere Scheidler | Gigi | 3 | West | |||||||||
11 | Theodore | Randolph | Pozo | null | Rey | Myron | Mcglothlin | Mattei | 01-12-20 | ID-8_Rey Myron Mcglothlin Mattei | 01-04-20 | ID-8_Rey Myron Mcglothlin Mattei | Yanaki | 12 | East | |||||||||
12 | Vance | Arnoldo | Mcglothlin | null | Ricky | Jamel | Buskirk | 01-01-20 | ID-9_Ricky Jamel Buskirk | 01-05-21 | ID-11_Theodore Grinnell Speth | Yanaki | 6 | Canada | ||||||||||
13 | Lindsey | Harry | Buskirk | null | Mel | Bradly | Buskirk | 01-01-20 | ID-10_Mel Bradly Buskirk | 01-01-20 | ID-13_Rey Jamel Dawkins Fogle | Quad | 18 | MidWest | ||||||||||
14 | Rudolf | null | Otten | null | Theodore | Grinnell | Speth | 01-01-20 | ID-11_Theodore Grinnell Speth | 01-12-20 | ID-13_Rey Jamel Dawkins Fogle | Crested | 12 | South | ||||||||||
15 | Ricky | null | Kitterman | null | Alfred | Jamel | Poulsen | Mattei | 01-09-20 | ID-12_Alfred Jamel Poulsen Mattei | 01-07-20 | ID-11_Theodore Grinnell Speth | Majestic | 18 | South | |||||||||
16 | Jesus | Jamel | Garth | Rey | Jamel | Dawkins | Fogle | 01-05-20 | ID-13_Rey Jamel Dawkins Fogle | 01-03-20 | ID-14_Houston Grinnell Levison | Gigi | 6 | South | ||||||||||
17 | Tom | Bradly | Enderle | Houston | Grinnell | Levison | 01-09-20 | ID-14_Houston Grinnell Levison | 01-03-21 | ID-19_Houston Myron Enderle | Yanaki | 3 | South | |||||||||||
18 | Freddie | Myron | Poulsen | Vance | Harry | Garth | Levison | 01-03-20 | ID-15_Vance Harry Garth Levison | 01-01-20 | ID-1_Theodore Kriger Ryburn | Crested | 12 | Canada | ||||||||||
19 | Alvin | Jere | Ybarbo | Rey | Bradly | Shelton | Ryburn | 01-03-20 | ID-16_Rey Bradly Shelton Ryburn | 01-01-20 | ID-2_Antione Myron Scheidler Fogle | Gigi | 6 | South | ||||||||||
20 | Alfonso | Silvestri | Rudolf | Bradly | Garth | 01-02-20 | ID-17_Rudolf Bradly Garth | 01-04-20 | ID-11_Theodore Grinnell Speth | Sunset | 12 | MidWest | ||||||||||||
21 | Eduardo | Scheidler | Eduardo | Jarrod | Dawkins | Fogle | 01-06-20 | ID-18_Eduardo Jarrod Dawkins Fogle | 01-04-20 | ID-18_Eduardo Jarrod Dawkins Fogle | Sunset | 6 | East | |||||||||||
22 | Alfred | Luiz | Houston | Myron | Enderle | 01-01-21 | ID-19_Houston Myron Enderle | 01-04-21 | ID-8_Rey Myron Mcglothlin Mattei | Sunset | 6 | NorthWest | ||||||||||||
23 | Rey | Kriger | Mel | Jamel | Valtierra | Hoge | 01-05-21 | ID-20_Mel Jamel Valtierra Hoge | 01-04-20 | ID-2_Antione Myron Scheidler Fogle | Sunset | 3 | NorthWest | |||||||||||
24 | Note: | 01-04-21 | 01-03-20 | ID-3_Antione Grinnell | Crested | 18 | Mexico | |||||||||||||||||
25 | We can set "null" cells if we want random | 01-02-20 | 01-03-21 | ID-6_Jesus Pasquariello Ryburn | Sunset | 18 | NorthWest | |||||||||||||||||
26 | created array to contain null strings | 01-09-20 | 01-03-20 | ID-13_Rey Jamel Dawkins Fogle | Quad | 3 | East | |||||||||||||||||
27 | 01-07-20 | 01-08-20 | ID-2_Antione Myron Scheidler Fogle | Majestic | 18 | MidWest | ||||||||||||||||||
28 | Create a random array | 01-04-21 | 01-01-20 | ID-3_Antione Grinnell | Majestic | 12 | NorthWest | |||||||||||||||||
29 | using this data | =ARANDOM(A30:B33,30) | Fun quest: | 01-02-20 | 01-09-20 | ID-17_Rudolf Bradly Garth | Gigi | 18 | Mexico | |||||||||||||||
30 | LG | phone | Hp | laptop | Does the random array | 01-04-20 | 01-01-20 | ID-6_Jesus Pasquariello Ryburn | Yanaki | 3 | NorthWest | |||||||||||||
31 | Samsung | camera | Hp | phone | created all pos.combinations? | 01-08-20 | 01-07-20 | ID-1_Theodore Kriger Ryburn | Yanaki | 3 | West | |||||||||||||
32 | Sony | laptop | LG | camera | =UNIQUE(D30#) | 01-03-21 | 01-12-20 | ID-3_Antione Grinnell | Crested | 6 | West | |||||||||||||
33 | Hp | Sony | laptop | Hp | laptop | 01-12-20 | 01-07-20 | ID-6_Jesus Pasquariello Ryburn | Gigi | 6 | Mexico | |||||||||||||
34 | Samsung | phone | Hp | phone | 01-12-20 | 01-12-20 | ID-12_Alfred Jamel Poulsen Mattei | Quad | 18 | Mexico | ||||||||||||||
35 | All possible | Samsung | phone | LG | camera | 01-09-20 | 01-01-21 | ID-14_Houston Grinnell Levison | Crested | 3 | South | |||||||||||||
36 | combinations | LG | laptop | Sony | laptop | 01-03-21 | 01-08-20 | ID-9_Ricky Jamel Buskirk | Majestic | 12 | NorthWest | |||||||||||||
37 | =ACOMBINE(A30:B33,) | LG | phone | Samsung | phone | 01-02-20 | 01-01-20 | ID-7_Houston Arnoldo Ybarbo | Yanaki | 18 | Mexico | |||||||||||||
38 | Hp | camera | Hp | camera | LG | laptop | 01-07-20 | 01-04-21 | ID-16_Rey Bradly Shelton Ryburn | Yanaki | 3 | South | ||||||||||||
39 | Hp | laptop | Samsung | laptop | LG | phone | 01-01-20 | 01-02-20 | ID-8_Rey Myron Mcglothlin Mattei | Quad | 6 | East | ||||||||||||
40 | Hp | phone | Samsung | camera | Hp | camera | 01-01-21 | 01-09-20 | ID-15_Vance Harry Garth Levison | Majestic | 6 | NorthWest | ||||||||||||
41 | LG | camera | Samsung | phone | Samsung | laptop | 01-02-20 | 01-08-20 | ID-8_Rey Myron Mcglothlin Mattei | Yanaki | 12 | South | ||||||||||||
42 | LG | laptop | LG | phone | Samsung | camera | 01-01-20 | 01-03-20 | ID-2_Antione Myron Scheidler Fogle | Majestic | 3 | Mexico | ||||||||||||
43 | LG | phone | Hp | camera | Sony | phone | 01-04-20 | 01-01-20 | ID-13_Rey Jamel Dawkins Fogle | Quad | 12 | Canada | ||||||||||||
44 | Samsung | camera | LG | laptop | Sony | camera | 01-12-20 | ID-18_Eduardo Jarrod Dawkins Fogle | Quad | 6 | Mexico | |||||||||||||
45 | Samsung | laptop | Sony | phone | 01-04-21 | ID-6_Jesus Pasquariello Ryburn | Quad | 12 | West | |||||||||||||||
46 | Samsung | phone | Samsung | laptop | If rows array above | other functions on minisheet | 01-03-20 | ID-13_Rey Jamel Dawkins Fogle | Quad | 12 | West | |||||||||||||
47 | Sony | camera | Samsung | laptop | is equal with rows array | ACOMBINE | 01-12-20 | ID-20_Mel Jamel Valtierra Hoge | Quad | 18 | Canada | |||||||||||||
48 | Sony | laptop | Sony | phone | of all posib.comb then yes | ADATE | 01-02-20 | ID-3_Antione Grinnell | Gigi | 3 | NorthWest | |||||||||||||
49 | Sony | phone | LG | laptop | otherwise no | ATEXTJOIN | ||||||||||||||||||
50 | Sony | camera | ||||||||||||||||||||||
51 | LG | laptop | =IF(ROWS(G33#)=ROWS(A38#),"Yes","No") | |||||||||||||||||||||
52 | Samsung | laptop | Answer: | |||||||||||||||||||||
53 | Samsung | camera | Yes | |||||||||||||||||||||
54 | Samsung | laptop | ||||||||||||||||||||||
55 | Sony | laptop | ||||||||||||||||||||||
56 | Samsung | laptop | ||||||||||||||||||||||
57 | LG | phone | ||||||||||||||||||||||
58 | Sony | phone | ||||||||||||||||||||||
59 | Samsung | phone | ||||||||||||||||||||||
60 | ||||||||||||||||||||||||
ARANDOM post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
K2,G51 | K2 | =FORMULATEXT(K4) |
F3,A37,G32,D29,Q3,L3 | F3 | =FORMULATEXT(F4) |
F4:I23 | F4 | =IF(G1="y",ARANDOM(A4:D23,20),F4#) |
K4:K43 | K4 | =ADATE(RANDARRAY(40,,"1-jan-20","30-05-21",1),"f",) |
L4:L23 | L4 | =ATEXTJOIN(F4#,"ID-"&SEQUENCE(ROWS(F4#))&"_",," ") |
Q4:U48 | Q4 | =IF(R1="y",ARANDOM(K4:O43,45),Q4#) |
D30:E59 | D30 | =ARANDOM(A30:B33,30) |
G33:H44 | G33 | =UNIQUE(D30#) |
A38:B49 | A38 | =ACOMBINE(A30:B33,) |
G53 | G53 | =IF(ROWS(G33#)=ROWS(A38#),"Yes","No") |
Dynamic array formulas. |
Upvote
0