Formula Formatter for Excel
Format or flatten Excel formulas from the ribbon or with a keyboard shortcut. Free and open source (MIT).
Just need to format one formula?
Use Formula Formatter Online: paste a formula, get it back formatted or flattened. Nothing to install, and it runs entirely in your browser.
Install
This add-in is not in Microsoft's add-in store. You install it yourself ("sideloading"), which takes about a minute. Pick your platform. Each option shows exactly what it changes on your computer.
Windows (Excel for Microsoft 365)
Option A: download and double-click.
- Download install.cmd. If your browser asks, choose Keep.
- Double-click it. If Windows shows "Windows protected your PC", click More info > Run anyway. That warning appears for any downloaded file that isn't signed by a paid certificate.
- Close all Excel windows and start Excel again.
- Go to Home > Add-ins and choose Formula Formatter for Excel under Developer Add-ins. The Formula Formatter tab then appears on the ribbon.
Want to see what it does first? Right-click the file > Edit (or open it in Notepad). It is a short, readable script, not a program.
Option B: one line in PowerShell. Open PowerShell (Start menu, type "PowerShell"), paste this and press Enter:
irm https://kmailmom.github.io/excel-formula-formatter/install.ps1 | iex
Then restart Excel and add it from Home > Add-ins > Developer Add-ins, as in step 4 above.
What the script changes: it saves manifest.xml to
%LOCALAPPDATA%\ExcelFormulaFormatter\ and adds one value under
HKCU\Software\Microsoft\Office\16.0\Wef\Developer pointing to that file. That's all.
It does not install programs, does not need admin rights and does not touch other settings.
Uninstall: download and double-click uninstall.cmd,
or run irm https://kmailmom.github.io/excel-formula-formatter/uninstall.ps1 | iex. It removes exactly those two things.
Mac (Excel for Microsoft 365)
Option A: one line. Open Terminal, paste this and press Enter:
curl -fsSL https://kmailmom.github.io/excel-formula-formatter/install-mac.sh | sh
Option B: by hand. Download the manifest and copy it into
~/Library/Containers/com.microsoft.Excel/Data/Documents/wef/ (create the wef folder if it doesn't exist).
Quit Excel (Cmd+Q) and start it again. Then go to Home > Add-ins and choose the add-in under Developer Add-ins.
Uninstall: delete excel-formula-formatter.xml from that wef folder.
Excel on the web
- Download the manifest file.
- In Excel on the web: Home > Add-ins > More Add-ins > My Add-ins > Upload My Add-in, and pick the file.
Menu names differ slightly between Excel versions.
Organisations (Microsoft 365 admins)
Deploy to users or groups from the Microsoft 365 admin center: Settings > Integrated apps > Upload custom apps, using this manifest URL:
https://kmailmom.github.io/excel-formula-formatter/manifest.xml
Layout density
Choose how compact the formatted formula is, from Expanded to Dense, under Options.
Is this safe?
You should ask that about anything you install. You don't have to take our word for it; here's what you can check.
- No network traffic. Your formulas are processed inside Excel and never sent anywhere. The add-in contains no analytics, tracking or cookies. The only external file it loads is Microsoft's own Office.js library.
- Checked on every release. Before every deploy, an automated check fails the build if the add-in's code uses any
browser function that can send data (
fetch,XMLHttpRequest,WebSocket, and so on) or references any other website. - Built in public. This site is built from the public source code by GitHub Actions. Every build log is public, and
the unminified source is published alongside the code (
taskpane.js.map). - Limited access. Excel only allows the add-in to read and write the open workbook. It runs in Excel's sandbox, like a web page, and cannot access your files or other programs.
- Short, readable installers. The installers are plain-text scripts of a few dozen lines, not compiled programs, so anyone can read exactly what they do. They change only what's listed above.
Details: SECURITY.md · privacy policy.
Updates
Excel loads the add-in from this site, so updates arrive automatically. Re-run the installer only when the release notes say so (for example when ribbon buttons change).