Have you ever needed to take a list and randomly sort it? How would you do it? It’s not as intuitive as you think. We’re so used to sorting lists in alphabetical order or from smallest to largest, but this idea of randomly sorting a list is not very common in Excel. Let’s jump right into it and show you how to randomly sort a list in Excel. Sample Data Say we have some data that we’d like to sort: Normally, we could sort by Movie title, the date that it opened (as it’s shown in the picture), or by the total amount it grossed. Nov 06, 2018 How to Create a Random Sample in Excel. This wikiHow teaches you how to generate a random selection from pre-existing data in Microsoft Excel. Random selections are useful for creating fair, non-biased samples of your data collection. For a Mac, you'll hold down ⌘. Microsoft Excel| Probability and Statistics. In other languages. How to Create a Random Sample in Excel. This wikiHow teaches you how to generate a random selection from pre-existing data in Microsoft Excel. Random selections are useful for creating fair, non-biased samples of your data collection. ![]() But what if we wanted to “shuffle” this list? How could we go about doing that? By the way, this is the same data that we used in the post. You can also copy and paste this table to follow along. Movie Date Opened Total Gross Deadpool 2/12/16 $363,070,709 Zootopia 3/4/16 $341,268,248 Batman v Superman: Dawn of Justice 3/25/16 $330,360,194 The Jungle Book (2016) 4/15/16 $364,001,123 Captain America: Civil War 5/6/16 $408,084,349 Finding Dory 6/17/16 $486,295,561 The Secret Life of Pets 7/8/16 $368,384,330 Suicide Squad 8/5/16 $325,100,054 Rogue One: A Star Wars Story 12/16/16 $532,177,324 Sing 12/21/16 $270,329,045 Randomly Sort a List in Excel To sort a list randomly in Excel, first you need to add a new column to your data. When using, you can simply type in a new column name at the next available table header and it will be automatically joined to your table. Here, we type in “Sort Order” and press Enter. Next, we need a way to randomly sort the list. We can use the RAND() function in Excel to help us with that. The RAND() function will return a number at random between 0 and 1. ![]() After we add the formula, we can sort by that column. This will randomize the list for us. Also, each time the RAND() function is calculated, you get a different number. This is why you see the table has all different numbers. Keep Shuffling Another cool tip is that if you’re not happy with the initial shuffling of the list, you can simply keep sorting between Ascending and Descending to keep shuffling the list. This works because when you sort the list, it recalculates the RAND() function, giving a new number each time. Keeping the List Order But what if you don’t want the RAND() function to keep recalculating? What if you want to keep the sort order? If you want to keep the sort order, you can simply save the values from RAND() before sorting again. Copy the list and do a Paste Special -> Values in order to keep the sort order.
Notes are meant to provide a general overview on how to input data in Excel and Stata and how to perform basic data analysis by looking at some descriptive statistics using both programs. Excel To open Excel in windows go Start – Programs – Microsoft Office – Excel When it opens you will see a blank worksheet, which consists of alphabetically titled columns and numbered rows. Each cell is referenced by its coordinates of columns and rows, for example A1 is the cell located in column A and row 1; B7 is the cell in column B and row 7. You can reference a range of cells, for example C1:C5 are cells in columns C and rows 1 to 5. You can also reference a matrix, A10:C15, are cells in columns A, B and C and rows 10 to 15.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |