RANDARRAY Function

%3CLINGO-SUB%20id%3D%22lingo-sub-2666166%22%20slang%3D%22en-US%22%3ERANDARRAY%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2666166%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20great%20a%2010%20x%2010%20cell%20grid%20that%20generates%20random%20numbers%201%20through%2010%20and%20does%20not%20repeat%20those%20numbers%20within%20a%20column%20or%20row.%3C%2FP%3E%3CP%3EMy%20operating%20system%20is%20Mac%20BigSur%2011.5.1%3C%2FP%3E%3CP%3EI%20have%20attached%20an%20example%20in%20its%20simplest%20form.%20If%20possible%20I%20would%20also%20like%20to%20be%20able%20to%20enter%20a%20number%20in%20any%20given%20cell%20and%20have%20the%20entire%20grid%20populate%20with%20this%20same%20unique%20randomness.%3C%2FP%3E%3CP%3EThanks%20for%20the%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2666166%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2666441%22%20slang%3D%22en-US%22%3ERe%3A%20RANDARRAY%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2666441%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1132520%22%20target%3D%22_blank%22%3E%40MadMike1717%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnless%20I'm%20mistaken--a%20distinct%20possibility--since%20you're%20limiting%20yourself%20(and%20us)%20to%2010%20whole%20numbers%2C%20between%201%20and%2010%2C%20in%2010%20rows%20and%2010%20columns%2C%20haven't%20you%20basically%20laid%20out%20the%20possibilities%20in%20your%20%22simple%20example%22%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20vary%20the%20sequence%20of%20rows%20or%20columns%20randomly%2C%20but%20not%20both%20at%20the%20same%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20one%20approach%2C%20with%20which%20I'm%20not%20fully%20satisfied.%20This%20uses%20the%20dynamic%20array%20function%20SORT%2C%20which%20does%20require%20the%20most%20recent%20version%20of%20Excel.%20Maybe%20it'll%20point%20you%20in%20a%20useful%20direction%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I am trying to great a 10 x 10 cell grid that generates random numbers 1 through 10 and does not repeat those numbers within a column or row.

My operating system is Mac BigSur 11.5.1

I have attached an example in its simplest form. If possible I would also like to be able to enter a number in any given cell and have the entire grid populate with this same unique randomness.

Thanks for the help.

3 Replies

@MadMike1717 

 

Unless I'm mistaken--a distinct possibility--since you're limiting yourself (and us) to 10 whole numbers, between 1 and 10, in 10 rows and 10 columns, haven't you basically laid out the possibilities in your "simple example"?

 

You could vary the sequence of rows or columns randomly, but not both at the same time.

 

Here's one approach, with which I'm not fully satisfied. This uses the dynamic array function SORT, which does require the most recent version of Excel. Maybe it'll point you in a useful direction

@mathetes :Thanks for the quick response. I have used the sort function but as you have stated it does not allow me to do both rows and columns at the same time.

This is the formula that I used for the sort function:=SORTBY(SEQUENCE(10,,0,1),RANDARRAY((10)))

This worked great for the randomness but I still have numbers that are the same in rows and columns.

 

@MadMike1717 

 

Just for the record, mine used SORT, not SORTBY

 

Again, I wonder if you haven't set yourself up for actually a fairly limited number of possible combinations precisely because the numbers must be whole integers between 1 and 10, in ten rows and ten columns.

 

Anyway, another Dynamic Array function to test out is UNIQUE, which can make sure that any one number appears only once. I'd be more confident of meaningful randomness if you allowed integers between 1 and 99, say.

 

Here's a video on the Dynamic Array functions, in case they're new to you.

https://www.youtube.com/watch?v=9I9DtFOVPIg

 

 

 

Learn everything about our brand-new Dynamic Arrays and how you can use them to build advanced spreadsheets. Arrays (CSE) have long been present in Excel, bu...