Smart Systems for Home

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

How to Randomize Letters in Excel: Simple Formulas

· 5 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 built-in button to randomize letters, but you can scramble the letters of a word or generate random letters with a formula that combines RANDARRAY, SORTBY, MID, and TEXTJOIN. Below are two reliable methods: one that shuffles the letters of an existing word, and one that produces random letters from scratch. Everything works in Microsoft 365 and Excel 2021+; older versions need a slightly different approach, covered in the FAQ.

What You'll Need

  • Microsoft Excel — Microsoft 365 or Excel 2021 or later for the main method (it uses RANDARRAY and TEXTJOIN with arrays)
  • A word or list of words whose letters you want to shuffle, placed in a cell such as A2
  • Basic familiarity with entering formulas in a cell

Step-by-Step

Method 1: Shuffle the letters of an existing word

  1. Open Excel and type the word you want to scramble into cell A2 (for example, HELLO).
  2. Click cell B2, where the scrambled result will appear.
  3. Type the following formula exactly: =TEXTJOIN("",TRUE,SORTBY(MID(A2,SEQUENCE(LEN(A2)),1),RANDARRAY(LEN(A2))))
  4. Press Enter. The letters of the word in A2 now appear in a random order in B2 — for example LOHEL or LLEHO.
  5. To shuffle more words, list them in column A (A2, A3, A4, and so on), then drag the fill handle (the small square at the bottom-right corner of B2) down alongside your list. Each row scrambles independently.
  6. To reshuffle the letters, press F9. Every RANDARRAY formula on the sheet recalculates and produces a new random order.
  7. To freeze the results so they stop changing, select the scrambled cells, copy them (Ctrl+C), then right-click and choose Paste Special > Values.

Method 2: Generate a random string of random letters

  1. Click an empty cell where you want the random text.
  2. Enter this formula to create a 10-letter random string (change both instances of 10 to alter the length): =TEXTJOIN("",TRUE,CHAR(RANDARRAY(10,1,65,90,TRUE)))
  3. Press Enter. You get a random 10-character string of capital letters, such as KQWZTXBRPM.
  4. For lowercase letters, replace 65 and 90 with 97 and 122 — these are the character codes for a through z: =TEXTJOIN("",TRUE,CHAR(RANDARRAY(10,1,97,122,TRUE)))
  5. Press F9 to generate a new string, and copy > Paste Special > Values when you want to keep one permanently.

Note: menu names like Paste Special can differ slightly between Excel for Windows, Excel for Mac, and Excel for the web, but the formulas above work identically in all three, provided your version supports dynamic array functions.

Common Mistakes

  • Forgetting the quotes in TEXTJOIN — the delimiter must be an empty string written as "", otherwise you get an error or unwanted separators between letters.
  • Using the formula in an older Excel version. RANDARRAY and TEXTJOIN-with-arrays require Microsoft 365 or Excel 2021+; in Excel 2016 or earlier you will see a #NAME? error.
  • Leaving the results live. Because RANDARRAY is volatile, every edit to the workbook reshuffles the letters. Paste as values if you need the scrambled words to stay fixed.
  • Pointing the formula at an empty cell. If A2 is blank, LEN(A2) returns 0 and the result is simply blank — check that your source cell actually contains the word.
  • Dragging the fill handle over the wrong range. Make sure the relative reference (A2) shifts correctly as you drag down; if you locked it as $A$2, every row will scramble the same word.

Tips

  • Spaces and punctuation count as characters, so "NEW YORK" will shuffle the space too. If that matters, remove spaces first with SUBSTITUTE(A2," ","") inside the formula.
  • To generate many random strings at once, make the RANDARRAY row count larger (for example 20) and TEXTJOIN will still merge them — or simply fill the formula down a column for one string per cell.
  • Want numbers mixed in? Use RANDBETWEEN inside a CHOOSE or extend the CHAR range logic to include digits (character codes 48–57).
  • Keep a copy of the original words in a separate column before pasting scrambled values, since Paste Special > Values overwrites the formula.
  • If you want each shuffled result unique per press, remember F9 recalculates everything on the sheet at once — including unrelated RAND formulas.

Troubleshooting

  • #NAME? error: your Excel version does not support RANDARRAY or SEQUENCE. Update to Microsoft 365/Excel 2021+, or use the legacy helper-column approach described in the FAQ.
  • #VALUE! error: the referenced cell likely contains a number or an error value instead of text. Wrap the reference as TEXT(A2,"0") or convert the source to text first.
  • The result never changes: calculation is probably set to manual. Go to Formulas > Calculation Options and select Automatic, then press F9.
  • Letters spill across multiple cells: you omitted TEXTJOIN or its delimiter. Re-enter the full formula, making sure TEXTJOIN wraps the rest.
  • Everything reshuffles when I type anywhere: that is normal behavior for RANDARRAY. Paste the results as values to lock them in.

Frequently Asked Questions

Can I shuffle letters in older Excel versions?

Yes, but it takes more work. In helper columns, list each letter with =MID($A$2,ROW(A1),1), add a column of =RAND(), sort both columns by the RAND column, then join the letters with a concatenation formula or a fixed =B1&B2&B3… chain.

Why do my scrambled words keep changing?

RANDARRAY and RAND are volatile functions — they recalculate on every worksheet change. Copy the cells and use Paste Special > Values to freeze a result you like.

Does this work in Excel for the web?

Yes. Excel for the web supports dynamic array functions, so both formulas run the same way as in the desktop app, including F9 to recalculate.

Can I shuffle letters case-sensitively or keep capitals in place?

Not with the simple formula — it treats every character equally. To keep certain characters fixed, shuffle only part of the string by adjusting the SEQUENCE and MID arguments, or split the word into pieces and rejoin them after shuffling.

Is there a non-formula way to randomize letters?

No built-in feature does this. Power Query can list and sort characters with a random sort column, and VBA can loop through characters, but for most people the single SORTBY formula is the fastest reliable option.