# Randomly Shuffling Data In A Column

Apr 19, 2007

This seems like an easy enough task, but I can't find a simple function (if there is one) to shuffle the data in a column. For instance, if I have a column with 50, 50, 20, 20, 10, is there a way to shuffle this data so it's listed randomly (e.g. 20, 50, 50, 10, 20)?

## Find Difference Between 2 Numbers In Same Column Arranged Randomly

Nov 29, 2012

I am trying to calculate Change for following set. The Calculate field below shows how to arrive at the change. Any logic that I can use to get to Change? Match AccountID and find change in Value from Wk =1 to Wk= 2 without using pivot table option

Wk
AccountID
Value
Change
Calculate

[Code]...

## How To Randomly Sort Rows Of Data

Dec 5, 2012

I have three columns of data that I want to randomly sort by row. It's important that each of the three adjacent cells in each row move together, i.e.

Before assortment:

A1 B1 C1
A2 B2 C2
A3 B3 C3

After random assortment:

A2 B2 C2
A1 B1 C1
A3 B3 C3

## Randomly Select Varied Amounts Of Data From A List

Sep 10, 2008

I have a list of people in column A and a list of Cities that they have visited in column B.

I need to check some of the cities they have visited monthly but don't want to check them all.

I have attached a sheet as an example (this has been scaled down).

The number of cities i want to check for each person varies each month depending on how many cities they have visited.

For example, John has visited 16 cities and i want to check 5 of them. I therefore want 5 random cities that he has visited to appear next to his name at the top. The real list of data is massive so this would be really useful if it is possible.

I have looked at rand but i can't get it to randomly give me more than one city, and i don't understand how to get it to give me say 5 cities one month and say 8 cities the next month purely based on a formula from another cell.

## Randomly Add Name To 5 Out Of 6 Boxes?

Feb 23, 2012

I have made a calendar in excel, and need to make the following work.

I have six boxes (each for one day of the week, excl. Sunday) and a separate box containing names. I need to come up with a way that excel will automatically add those names to any five of the six boxes at random (always leaving exactly one box free for each name), and always choose which box at random.

## How To Pick 50 Numbers Randomly

Dec 10, 2013

In sheet1 columnA I have some data from that i want to copy randomly 50 rows to sheet2.

## Randomly Match 2 Columns With Each Other

Sep 18, 2008

Basically I have 2 columns:
column 1 is numbers 1,2,3
column 2 is letters a,b,c etc

I'd like a macro that randomly matches column 1 and 2

e.g
1 c
2 p
3 n

but i'd like it so that the number 5 always returns z

## Select Fields At Randomly

Apr 11, 2008

I have a workbook with sheet 1 called Support which is basically an input form. The second sheet is called Database.

I want to enter data into the form and via a macro copy the data to the database. I have followed a text book to the letter on how this is to be completed to the letter.

My problem is that when the data is written to the database some of the fields are blank. Using F8 I can step through the VB script which appears to select fields at random.

## Randomly Choosing Between 4 Numbers

Feb 9, 2007

Is there a function in Excel that would randomly select one of the 4 specified numbers?

## Randomly Sort Set Of Numbers

May 8, 2012

I have a 1x20 array with the numbers 1 thru 20 inside. I want a piece of vba code to randomly sort them. I will do this in a loop to create different "starting arrays" for an optimization code. I just need to be able to randomize the beginning. How is this done? I cant have duplicates.

## Randomly Pair Up Players

Nov 19, 2012

I am trying to make code to randomly pair up players. I have found code which makes a button that randomly pairs up players in a list but I want to make it so that ? players are paired with ? other players instead of everyone at the same time so that a person dosn't get paired with more then one player at a time.

E.g. take the first 6 players in a last and pair them with the second 6.

This is the code I found:

Private Sub CommandButton1_Click()
Dim x As Range, RanRng As Range, z As Range, oRes, Ray
Dim i As Integer, j As Integer, real, oSt As Integer, cl As Range
Dim oCol As Integer
Set RanRng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))

[Code] ........

## Randomly Generated Numbes

Aug 30, 2007

I wish to create a new sheet/workbook which promts the user to enter a start number and an end number. I want to then display 20% of randomly picked numbers between the start and end figures.

For example, the user enters 1 as a start and 20 as an end figure. 20% of this is 4, hence I want the system to randomly return 4 numbers between 1 and 20.

## Select Names Randomly

Apr 17, 2009

I'm trying to pull 20 random names from a list of them every time I open the spreadsheet, and have them copied onto the clipboard to be pasted wherever. I have some code I found to accomplish this, but I'm not exactly what you would call VBA savvy. Could anyone look at this and see what I'm doing wrong? Or if it is right what I'm doing wrong to get it to work?

Sub GetRandom()
Dim iRows As Integer
Dim iCols As Integer
Dim iBegRow As Integer
Dim iBegCol As Integer
Dim J As Integer
Dim sCells As String

Set TempDO = New DataObject

## Display Records Randomly

Apr 21, 2007

give me the script (syntax) and place to be written it in a form in ms access 2003.

1. Text box1 should be displayed the value of field1 from table randomly, when I click the command button1.

2. Text box2 should be displayed the value of field 2 of the same record, when I click the command button 2.

## Join 1st & Last Names Randomly

Apr 22, 2008

This request is for Excel 2003 rather than 2007 (company does not have Vista or 2007 as I do personally). When two columns are used for an employee's 1st Name and 2nd Name, what is the random formula for combining BOTH columns in a random name pull? Since two people may have the same LAST name, only by accessing both column one (typically LAST name) and column 2 (first name) can they be identified if both last names appear in a random pull. I have used the random generator available from Excel Help online but do not know how to modify the parameters to accomplish keeping the first and second names from Column A and Column B together in the pull.

Explaining this will be widely useful for any company (such as trucking) using Excel for employee first and second names in two columns (assume A1 header 'Last Name', A2 header 'First Name'). Such companies need to be able to do a random pull to comply with DOT (Dept of Transportation) CDL re-certification, substance abuse screens, etc. I am just above a NOVICE user (I have a dozen books I try to learn from before asking).

## Cell Values Change Randomly

Aug 14, 2014

I created a multipage spreadsheet to track stocks. Two pages import quotes from Microsoft automatically about every 10 minutes. The main page organizes these stock quotes next to the symbols. Stock price, \$ change, then % price change.

For example, for symbol INTC,
PRICE cell is =Quotes!D120.
\$ change is =Quotes!J120
% change is =Quotes!I120

Now all of a sudden, during a random refresh, EXCEL IS CHANGING THE VALUES from D120 to AB120. J120 to AG120. I120 to AH120. That was after fixing it earlier today. Earlier today it randomly changed those values to something else. Like A, T, and V substitutes for the proper fields. This is happening to about 10 stocks in a row, but I think I saw it on a couple others earlier. It is as if someone is changing these fields (but they aren't!) The fields on the pages being pulled from are staying the same.

Using Office (Excel) XP on a Windows 7 PRO 64-bit OS.

## Randomly Pairing Wrestlers In A List?

Nov 23, 2013

I want to be able to input wrestlers names and pair them up for 2 matches randomly. Is there any way to do this? I am not advanced in excel, but not a novice either. I need to make sure they don't wrestle the same people in each round. Also there will be wrestlers from the same team, so is there any way to try and not pair them together unless it is necessary?

## Randomly Selecting A Cell From A Range

Oct 14, 2008

I need a cell to display the (text) content of 1 of 25 cells. example: I have text content in all cells ranging A1:A25. I want cell B1 to display the content of 1 of these at random. is there a function for this or do I need to use a macro?

## Randomly Pick 1 Set Of Initials From List

Apr 22, 2012

cell a1 is blank
cell a2= "sb"
cell a3= "db"
cell a4 is blank
cell a5= "rm"
cell a6= "kw"

I want to randomly pick 1 set of initials from the 4 listed in the 6 cells and put the result in cell a7.

## Randomly Select Items From DV Lists

May 14, 2012

I have a column of DV lists. Is it possible for me to make excel, go through each DV list, and randomly select an item from each DV list?

## Randomly Select Cell With Message Box?

Feb 15, 2013

The macro below will randomly pick a cell (with names)and fill with color. What I want to add is after it pick a cell a msgbox with a name of that person with YES/NO, if YES fill color. I need it not duplicate once it has already selected that cell(person).

Code:
Function RandCell(Rg As Range) As Range
Set RandCell = Rg.Cells(Int(Rnd * Rg.Cells.Count) + 1)
End Function

[Code]....

## Return Value Randomly From A Range Of Cells

May 16, 2013

I'll be collecting registrations on an Excel worksheet at a company event. Users will fill out a registration form, click a button, and the information is moved to a hidden sheet. That part works perfectly.

Periodically during the day, we'll give out door prizes, selecting winners from the list of registrants.

I need a macro that will look at the entries in column A in my hidden sheet and return one of them randomly.

I know there are random number generators, and I could make one of those work, but if I could just have it make a random selection from the populated cells in Col A, that would be slicker.

## VBA To Randomly Assign Values To A Cell

Jun 29, 2014

I am trying to make a macro that when clicked, will randomly choose one of 7 values and type that into cell C4. Values can be Dodgeball, Football, Soccer, Tetherball, Soccer, Baseball, Basketball. Is this doable?

## Sorting A List Randomly, And Fairly.

Jul 17, 2007

I have a list of potential competitors in an event, and am using both RAND and ROUND to sort them into a list of 1's and zeros. My formula is as follows: =ROUND(RAND()*1,0). My problem is that I get an uneven distribution of players, out of a list of forty, I may have 38 people that are 1's and 2 people that are 2's. I'd really like the list to be randomized, but evenly to allow for fair competition.

## Randomly Assign Players To Teams

May 5, 2007

I am trying to assign a list of players onto teams but I need to distribute "skill" evenly to ensure teams are equally matched.

A statistician in the league suggested the best way to do this might be to sort the player list (descending) by the measure of "skill", then start assigning teams in blocks. If I have 40 players in the league / 4 teams = 10 players per team. I would randomize the numbers 1-4 (e.g. 3 1 4 2) and assign them to the first four players, randomize another set of 1-4, assign them to the next, and so on...

I could then sort the player list by “team assignment” column and have hypothetically equal skill on every team.

Couple of complications... number of players and teams might vary season to season. I will have to enter in number of teams and number of players at the beginning of each season along with a new list of their stats. Also, although I have a limited knowledge of Excel and VBA, none of the other coaches do so I want to make this as idiot proof as possible.

Using various macros (or functions) I found here I was able to randomize the first "block" of players but I cannot complete the randomizations for the remainder of the list. The only solution I have found would be to manually create an array using the “RandUnique” function over X (depending on number of teams) cells and then copy and paste this randomized subset down the rest of the player list.

See attached for sample data.

## Randomly Sorting List Of Numbers Into Different Permutations

Mar 1, 2014

with this problem (which I've been trying for weeks to solve).

I have a column ("C") of 640 numbers, which I need to randomly sort and place into the adjoining (ten thousand) columns. I then need to correlate each of these 10k columns with column "B".

The problem I have with the attached (which works for small numbers), is that when I increase the table size to 640 rows and anything more than a dozen or so columns, it takes forever to calculate and Excel often crashes.

random ver 1.04 280214.xlsx

## Arrange Numbers 1 To 11 Row Wise Randomly With No Repetition

Mar 29, 2014

Arranging row wise an array of numbers from 1to 11 randomly with no repetition. I need it for 700 rows.

Sub test()
Dim a1(1 To 11, 1 To 2) As Double, a2(1 To 11, 1 To 2) As Double, a3(1 To 11, 1 To 2) As Double
Dim a4(1 To 11, 1 To 2) As Double, a5(1 To 11, 1 To 2) As Double, a6(1 To 11, 1 To 2) As Double
Dim a7(1 To 11, 1 To 2) As Double, a8(1 To 11, 1 To 2) As Double, a9(1 To 11, 1 To 2) As Double
Dim a10(1 To 11, 1 To 2) As Double, a11(1 To 11, 1 To 2) As Double, i As Integer
Randomize

[Code] .....

## Randomly Group N Elements (where N Is Factor Of 7) Into Groups Of 7

Oct 7, 2013

I want to group N elements which is a factor of 7 into groups of 3 randomly. For example, I have 21 elements:

ZSW
PMH
NYV
JTX
DEF
CRK
AOI

I want to group them into 6 more sets. Now, all in all 7 sets. Group them into other sets without the element repeating in the row it has occupied before. For example, for letter P. "P" has occupied row 2 in set 1, it cannot occupy row 2 anymore in other sets. Therefore, each element must have occupied row 1-7 in all the sets.

See attached excel file for the example output : grouping7-final.xlsxâ€Ž

## Randomly Select One Of Two Cells To Populate From List?

Oct 16, 2013

I am wanting to randomly select one of two cells and then populate that cell from a list I have on a different sheet.

## Randomly Select From Table With Blank Cell

Oct 31, 2013

I am trying to randomly select 10 data from a table by using index formula. But there are some blank cell in the table so It kept returning 0 in the cell.

problem.xlsx