4. Rand() Function
Creates decimal Random Numbers
From 0.000…001 to 0.999…999
Conversion into whole numbers/integers may be required
5. RandBetween (Lowest, Highest) Function
Creates random integers in specified range
Duplicates can occur
Remove duplicates by Remove Duplicates function
6. Random Numbers are VOLATILE
They change whenever an entry is made or file is opened
Freeze them by Copy => Paste Special => Values function
8. Steps to draw a Sample of 100 Students from a
population of 1000 Applicants for a Trip
Make a list of 1000 applicants (Population) using Serial Numbers (SN_P) from 1 to
1000 and unique Registration No (RN) of each`
Make a second list of 100 Sr No from 1 to 100 (SN_S) to serve as starting point of
selection list
To the right of each SN_S, place a random number from 1 to 1000 e.g. 872, 586,
572 etc.
These 100 random numbers are the serial numbers of students from the population
list, who will be sent on the trip.
Next step is to read the Unique ID (RN) of each selected student and copy it to the
selection list
9. Let us Practically Select a Sample of 100
Students out of 1000 who applied for a trip
Open a new Excel Worksheet
Type the headings as in next slide
10. • SN_P = Serial Number (Population)
• SN_S = Serial Number (Selected Sample)
• Random No = SN_P of selected students
• RN = Registration No. of relevant
students
Job Description
Area for
Population Data
Entry
Area for Sample
Data Computation
11. Fill SN_P from 1 to 1000 from cells A5 to
A1004 (next slide) by your preferred method
13. To avoid unnecessary labour,
generate a Random No. here by
entering the formula shown in
Formula Box. In practice, RN
would be real & NOT Random
No.
Formula in
Formula Box
14. Double Click on the
Fill Handle to copy
formula to all SN_Ps
19. Select all data or only Random Numbers => Copy =>
Paste Special => Paste Values to freezw data i.e. to
prevent recalculation of Random Numbers.
20. Select ALL items in Random No. Column
(Col G) => Data => Remove Duplicates
21. • If we had generated 125 Random Numbers
instead of 100, even after removal of 5
duplicates, we are left with 20 Random
Numbers extra.
• Remove the extra Random Numbers so that
SN_S and Random Numbers match
23. Sr No. 674, 1000, 75 etc are the SN_Ps which have
been selected by generating Random Numbers
24. Getting Regn. Numbers of Selected Students from
their Sr No.
Use VLookUp(LookUp Value, Location, Column No. of interest)
LookUp Value is each selected Sr. No.
Location is Population Data (A5:B1004) i.e. SN_P and RN of Population
As you copy the formula down the list, cell reference values (A5:B1004) will change.
Prevent it by giving a meaningful name to this cell range e.g. Population
Column of interest is Col. 2 i.e. RN (Col B)
26. Vertically lookup contents of F5 (674) in the
range “Population”(A5:B1004) and when you
find it, copy the contents of Col 2 (RN) in the
cell in which this formula is contained (G5)
27. Double Click on the
Fill-handle to copy the
formula down to all
the cells which
contain data on their
left
29. Job Completed! Beautification is your choice!
Sorting the list as per Regn. No (RN)
Darker shade to Population area and lighter shade of same colour to Sample area
Combination of the two suggestions