I usually prefer writing my own logic in Excel, so I was hesitant to start using the Formula by Example tool. But when it turned my manual patterns into a perfectly structured formula, it became the assistant I didn't know I needed. If you're tired of syntax errors, this is the feature you've been waiting for.
At the time of writing (January 2026), Formula by Example is available in Excel for the web (as long as your data is inside an Excel table) and for those using Excel for Windows with a Copilot subscription. All examples and screenshots in this guide use Excel for the web, which offers the most seamless no-menu experience.
Formula by Example vs. Flash Fill
At first glance, you might mistake Formula by Example for the classic Flash Fill feature we've been using since 2013. Both tools look at your manual typing and try to finish your work for you, but that's where the similarities end.
Flash Fill is a one-trick pony that gives you a one-time snapshot of your text. For example, if you use it to extract initials from a list of names, the result is hard-coded into your cells. If you go back and change "John Doe" into "Jane Smith," the cell still stays as "JD," so you have to re-run the process every time your data changes.
On the other hand, as well as giving you the answer, Formula by Example tells you the math behind how it got there. Due to this dynamic behavior, your results update automatically if the source data is modified or if you add new rows to your table.
Feature
Flash Fill
Formula by Example
Output type
Static values
Dynamic formulas
Persistence
Breaks if data changes
Updates automatically
Best for
One-off, quick cleanups
Long-term data projects
Visibility
Hidden logic
Visible, editable code
Availability
All versions of Excel
Web (in tables) or Windows (Copilot)
While a similar tool in the Power Query Editor called Column from Examples has been around for years, Formula by Example is unique because it brings that same intelligence directly to your standard spreadsheet grid as a live, editable formula.
How to use Formula by Example
Suppose you're working on this formatted table in Excel for the web and want to populate the Email and Discount columns.
Starting with the Email column, type the exact result you want to see in the first cell. In this case, the email addresses are [first name]_[state]@mail.com. So, Jonathan's email address is [email protected].
Related How to Remove Hyperlinks in Microsoft Excel
Sometimes, plain text URLs are good enough!
Posts
Then, to establish the pattern, select the second cell and type the next result ([email protected]). Usually, by the time you finish the second or third example, Excel's brain kicks into gear. When you see the pop-up window, you have three options: accept the suggestion by clicking "Apply," reject it by clicking "Ignore," or review the logic by clicking "Show Formula."
If you accidentally reject a suggestion, it might not come back if you try again. This is because Excel for the web sometimes blacklists a column if it thinks you don't want its help. When I encounter this problem, a quick browser refresh usually fixes it.
After you apply the suggestion, the rest of the column is populated, and you can see the formula in the formula bar.
As well as working with text, Formula by Example can also deal with numbers. Here, it has worked out that the values in the Discount column are 1% of the values in the Cost column.
With the formulas now complete, as soon as I add a new row of data to row 7, those two calculated columns are populated automatically.
Reverse-engineering the process: Learning from the machine
One of the best perks of Formula by Example is that it doubles as a personal Excel tutor. When Excel generates a suggestion, it constructs a legitimate formula, so rather than just accepting and moving on, take a moment to review the logic.
By studying these results in the formula bar, you can:
Expand your vocabulary: Discover the functions the tool uses to keep the formula efficient. Master table syntax: See exactly how Excel uses structured references to point to data within a table. Avoid syntax errors: Seeing a perfect version of a formula helps you understand where those pesky commas and parentheses usually belong.
I've found that seeing the formula applied to my own messy data is far more effective than reading a generic manual. Once you know how the machine solved your specific problem, you'll find yourself much more confident when it's time to write one from scratch.
Related Prove Your Real-World Microsoft Excel Skills With the How-To Geek Test (Advanced)
Can you execute complex Excel tasks?
Posts By Tony Phillips Points to note before you start
Even though watching Formula by Example can feel like watching a magic trick, like any AI-driven feature, it requires a human editor-in-chief to ensure the logic holds up under pressure. Use these tips to get the most out of the tool:
Show it the messy data: If you know your data has inconsistencies, try to include one of those "difficult" rows in your first few manual examples. Refine the logic: If the tool makes a mistake halfway down the column, don't panic. Simply type the correct value into the cell that Excel got wrong, and the AI will try to rewrite the whole column's formula to accommodate the new logic. Check the formula bar: Always glance at the formula Excel wrote. If it looks overly complex for a simple task, it might be prone to breaking later. Spot-check the extremes: Scroll to the bottom of your table to double-check that the formula is still extracting the correct data. Use helper columns: Formula by Example can't read your mind. If your logic involves multiple steps, such as extracting a year, calculating length of service, and then multiplying by a bonus rate, the mathematical leap may be too wide for the AI. Break the task into intermediate milestones using helper columns to help the engine follow your trail.
Ultimately, Formula by Example lets you stop obsessing over where the commas go and start focusing on what your data is actually trying to tell you. Of course, using AI in Excel spreadsheets isn't for everyone, but because the web version of Formula by Example doesn't require you to open any menus or sidebars, it feels less like a forced upgrade and more like a natural evolution of the grid. If it saves you from even one #VALUE! error, it's a tool worth keeping in your back pocket.
Microsoft 365 Personal OS Windows, macOS, iPhone, iPad, Android Free trial 1 month
Microsoft 365 includes access to Office apps like Word, Excel, and PowerPoint on up to five devices, 1 TB of OneDrive storage, and more.
$100 at Microsoft Expand Collapse