Flash Fill in Excel: How Ctrl+E Splits and Combines Text Automatically

 

Flash Fill in Excel: How Ctrl+E Splits and Combines Text Automatically

Flash Fill spots a pattern in what you type and fills the rest of the column to match. Type the result you want in the first row next to your data, start the second row or press Ctrl+E, and Excel completes the whole column for you. It works on text, so it's ideal for splitting names, joining pieces together, or reformatting things like phone numbers, without writing a formula.

One afternoon I had about 600 customer phone numbers pasted in as a single block of digits, like 0412345678, and a request to make them readable as 0412 345 678 for a mail-out. My plan was to build a formula with LEFT, MID and RIGHT, which would have worked fine. A colleague walked past, watched me typing the formula, and said, "Why not just type the first one how you want it and hit Ctrl+E?" I did. The other 599 filled in before I'd finished sighing. I'd had Excel for years and never touched Flash Fill, mostly because I assumed anything that clever must be unreliable. It mostly isn't, though it does have limits, which I'll cover.

How do I use Flash Fill?

  1. Put your source data in a column, for example full names in column A
  2. In the cell beside the first entry (B2), type exactly what you want, such as just the first name
  3. Press Enter to move down, then press Ctrl+E

Alternatively, go to Data > Flash Fill. Sometimes Excel will also show a faded preview of the rest of the column as you start typing the second example. If the preview looks right, press Enter to accept it.

Flash Fill needs the result column to sit directly next to the source data, and the source data needs a clear heading row above it. If nothing happens, that's the first thing to check.



What can Flash Fill actually do?

JobExample inputYou typeResult
Extract first nameJane SmithJaneJane, Peter, Mei...
Extract last nameJane SmithSmithSmith, Jones, Chen...
Combine columnsJane / SmithSmith, JaneSame format down the column
Reformat phone numbers04123456780412 345 678Same spacing pattern throughout
Change casejane smithJane SmithCapitalised for every row
Pull part of a codeNSW-4821-B4821The middle section of each code

If you've read my post on "text functions", every job in that table could also be done with LEFT, RIGHT, MID or TEXTJOIN. Flash Fill gets there faster for a one-off, and the functions are better when you need the result to keep working.

Why isn't Flash Fill working for me?

A few common causes, roughly in order of how often I see them:

  1. Flash Fill is switched off. Check File > Options > Advanced and make sure Automatically Flash Fill is ticked. Ctrl+E should still work manually either way.
  2. The result column isn't directly beside the data, or there's a blank column in between.
  3. There's no clear pattern yet. One example sometimes isn't enough. Type a second example in the next row, and Excel often locks on.
  4. The source data is inconsistent. If some rows have middle names and others don't, Excel has to guess, and it may guess wrong for the odd ones.
  5. The data isn't text. Flash Fill works best on text. Dates and numbers can behave unpredictably, so check a few results.

Why did Flash Fill fill in some rows wrong?

Because it's pattern-matching, not following a rule you wrote. It looks at your example and makes its best guess at what you meant, and when the data isn't uniform, its guess can be wrong for a handful of rows without any warning. There's no error message, the wrong value just sits there looking plausible.

My habit is to scroll through the filled column and look at the unusual rows: the very short entries, the very long ones, the ones with extra spaces or odd characters. If you've read my post on "cleaning messy data", running TRIM over the source data first removes a lot of the oddities that cause Flash Fill to misfire.

Does Flash Fill update when my data changes?

No, and this is the biggest difference from a formula. Flash Fill writes plain values into the cells. If you later change a name in column A, the Flash Filled column won't change. A formula would.

So here's the rule I follow:

  • One-off clean-up, data won't change: Flash Fill is quicker
  • Ongoing report, new data arriving every week: use a formula, so the result updates itself


Is Flash Fill available in every version of Excel?

Flash Fill was introduced in Excel 2013, so it's in Excel 2013 and later, including Microsoft 365. It isn't available in Excel 2010 or earlier. The exact menu wording can differ slightly between versions, but Ctrl+E has been the shortcut throughout.

FAQ

What's the keyboard shortcut for Flash Fill? Ctrl+E on Windows. You can also find it under the Data tab, in the Data Tools group. On Mac, the shortcut is generally Ctrl+E as well, though it's worth checking in your own version.

Can Flash Fill combine data from more than one column? Yes. If first names are in column A and last names in column B, type the combined format you want in column C for the first row, such as "Smith, Jane", then press Ctrl+E.

Can I undo a Flash Fill? Yes, Ctrl+Z reverses it, since it's a normal Excel action rather than a macro. After a Flash Fill, you'll also see a small smart tag appear beside the filled cells with the option to undo or accept the suggestions.

Why does Flash Fill drop the leading zero from my numbers? If the source cells are stored as numbers, Excel doesn't keep a leading zero. Make sure the source column is formatted as text before you start, so phone numbers like 0412345678 keep their zero.

Should I use Flash Fill or Text to Columns? Text to Columns splits a column into several based on a delimiter like a space or comma, and works well for consistent data. Flash Fill is more flexible when the pattern is irregular or when you want to combine or reformat rather than just split.

Comments

Popular posts from this blog

How to Record a Macro in Excel (No Coding Needed)

Excel Charts: How to Choose the Right Chart Type