Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Random Picker in Excel: Pick Names or Items Fast

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Excel has no single "random picker" button, but you can build one with two built-in functions: RANDBETWEEN to generate a random number and INDEX (or XLOOKUP) to turn that number into a name from your list. The shortest working version for a list in A2:A11 is =INDEX(A2:A11,RANDBETWEEN(1,10)). Press F9 or recalculate to draw a new pick. For a pick that stays fixed until you refresh it, use =INDEX(A2:A11,RANDBETWEEN(1,COUNTA(A2:A11))) in a helper cell and copy it as a value when you want to lock it in. Labels and function availability can differ slightly by Excel version, so if one of the formulas below is rejected, check your version's function list.

What You'll Need

  • Microsoft Excel on Windows, Mac, the web, or the mobile app. The desktop and web versions handle recalculation best; the phone app works but is fiddly to type formulas on.
  • A list of the names or items you want to pick from, typed in a single column with no blank cells in the middle. Blanks are the most common cause of a wrong pick.
  • Basic comfort with clicking a cell and typing a formula in the formula bar.
  • Optional: a second column of numbers if you want to try the ranking method described later.

Step-by-Step

  1. Lay out your list cleanly. Type your entries in one column, for example A2:A11, with one entry per cell and no gaps. If you have a header, put it in A1 so the range A2:A11 is purely the candidates. Blank cells inside the range will still be counted by COUNTA only if they are non-empty, so keep the range tight to your data.
  2. Pick an empty cell for the result. Click somewhere off to the side, such as D2. This is where the picked name will appear.
  3. Enter the basic formula. Type =INDEX(A2:A11,RANDBETWEEN(1,10)) and press Enter. INDEX returns the item at the position RANDBETWEEN produces, so you get a random name from your ten entries. Adjust the range and the upper number (10) to match your own list length.
  4. Make it self-adjusting. Instead of hard-coding the count, use =INDEX(A2:A11,RANDBETWEEN(1,COUNTA(A2:A11))). COUNTA counts how many non-empty cells are in the range, so if you add or remove a name the formula still works without edits.
  5. Test the recalculation. Press F9 on Windows (or Fn+F9 on many laptops) to force a recalculation. Every recalculation produces a new random number, so the picked name usually changes. Clicking into the cell and pressing Enter, or editing any other cell, will also trigger a new draw in automatic calculation mode.
  6. Lock in a winner. Once you see a pick you want to keep, select the cell, copy it with Ctrl+C (Cmd+C on Mac), then right-click and use Paste Special > Values to replace the formula with the plain text. The name then stays put and no longer changes on recalculation.
  7. Draw several picks without repeats. In B2 type =RAND() and fill it down to the last row. In C2 type =RANK(B2,$B$2:$B$11) and fill down. Each row now has a unique random rank. To get your first three picks, enter =INDEX($A$2:$A$11,MATCH(1,$C$2:$C$11,0)), then the same with MATCH(2,...) and MATCH(3,...). This gives a random order without duplicates, which a plain RANDBETWEEN cannot guarantee.
  8. Convert the helper columns when done. Copy the RAND and RANK columns and paste them back as values so the order stops shuffling while you read it. Keep the original list untouched.

Common Mistakes

Hard-coding the wrong count. If your list has 25 names but the formula says RANDBETWEEN(1,10), you will only ever see the first ten. Use COUNTA so the upper bound matches reality.

Leaving blank rows inside the range. INDEX will happily return a blank if RANDBETWEEN picks a gap. Trim the range or delete empty rows first.

Expecting the pick to stay still. RANDBETWEEN is volatile: it recalculates whenever the sheet recalculates, which happens on every edit in automatic mode. People screenshot a pick, keep typing, and are surprised it changed. Paste as values to freeze it.

Using RAND() twice for the same row. If you sort by a column containing RAND(), Excel evaluates it again during the sort and you can get a different order than you saw. Paste the RAND column as values before sorting.

Mistaking RANDBETWEEN's range. Both endpoints are inclusive, so RANDBETWEEN(1,10) can return 10. That is what you want, but it means a list with 10 rows needs an upper bound of 10, not 9.

Tips

To draw a name from another sheet, reference it by name in the formula, for example INDEX(Sheet2!A2:A50,RANDBETWEEN(1,COUNTA(Sheet2!A2:A50))).

If you are picking a prize winner live, put the result cell in a large font and press F9 in front of the audience; the flicker of names is the suspense.

Use a fixed seed only if you need repeatability. Excel has no simple seed setting for RANDBETWEEN, so repeatability is not reliable; instead, record the final value with Paste Special > Values when the outcome matters.

For weighted picks (some entries more likely than others), give each row a weight in a helper column, build a running total with SUM, and use RANDBETWEEN(1,total) matched against the running totals. This is more work but is the only fair way to bias a draw.

Keep a separate copy of the source list so later edits to the picker do not damage the data you draw from.

Troubleshooting

If the cell shows #NAME?, the function name is misspelled or your version does not recognise it. Check the spelling of INDEX, RANDBETWEEN and COUNTA, and make sure the equals sign is at the front.

If you see #VALUE! or #NUM!, the upper bound of RANDBETWEEN is probably zero or negative, which happens when COUNTA returns 0 because the range points at the wrong column or an empty sheet.

If the pick never changes, calculation may be set to Manual. On Windows, go to the Formulas tab and choose Calculation Options > Automatic. In the web version this is usually the default. On Mac, check the calculation settings in the Formulas ribbon area.

If the result shows a number instead of a name, INDEX is pointing at the wrong column. Re-select the cells you want returned and rebuild the formula.

If every recalc gives the same name, check that your RANDBETWEEN upper bound actually exceeds 1. A bound of 1 always returns 1.

If the sheet has become slow with many RAND() cells, replace them with pasted values once the draw is done; volatile functions recalculate constantly and large numbers of them slow everything down.

Frequently Asked Questions

Can I pick a random name without repeating anyone?

Yes. Use the RAND and RANK helper-column method above, or draw the plain pick and delete that name from the list before drawing again. The helper method is the reliable way to get a full shuffled order.

Does the pick change when I open the file again?

Usually yes, because opening the workbook triggers recalculation. If you need the winner preserved, paste the result as a value.

Is RANDBETWEEN truly random and fair?

It is a pseudo-random number generator, which is fine for office draws, classroom picks and games. It is not suitable for lotteries or anything needing certified randomness.

Can I use this in Excel for the web or on my phone?

Index, RANDBETWEEN and COUNTA all work in Excel on the web and in the mobile apps. Typing long formulas is easier on a computer, and some calculation settings differ between the desktop and web versions.

What is the difference between RAND and RANDBETWEEN?

RAND returns a decimal between 0 and 1, useful for sorting into a random order. RANDBETWEEN returns a whole number between two limits you choose, which is what you need for picking a position in a list.

Can I pick a random cell from a whole table, not just one column?

Point INDEX at the full range, for example A2:C20, and supply both a row and a column argument: INDEX(A2:C20,RANDBETWEEN(1,19),RANDBETWEEN(1,3)). That returns a random cell from the block.