To export formulas from Excel, you can use the "Show Formulas" mode to copy them as text, use the FORMULATEXT function to extract them into adjacent cells, or use a Find and Replace trick to convert them into strings. These methods allow you to document your logic, share complex calculations with colleagues, or archive your workbook's architecture without the recipient needing to click into every single cell to see how the result was achieved.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- An active Excel workbook containing the formulas you wish to export.
- A secondary destination for the formulas, such as a new Excel sheet, a Word document, or a plain text editor like Notepad or TextEdit.
Step-by-Step
Depending on whether you need to export a few formulas or an entire sheet of complex logic, choose one of the following three methods. Note that menu labels may differ slightly depending on your version of Excel or your operating system.
Method 1: Using "Show Formulas" for Bulk Copying
This is the fastest way to see every formula on a sheet at once and copy them into another document as literal text.
- Open the Excel workbook and navigate to the specific worksheet containing the formulas.
- Go to the Formulas tab on the top ribbon.
- In the Formula Auditing group, click the Show Formulas button. Alternatively, you can use the keyboard shortcut
Ctrl + `(the grave accent key, usually located above the Tab key). - Excel will expand all columns to show the raw formulas instead of the calculated results.
- Highlight the range of cells you wish to export.
- Press
Ctrl + C(Windows) orCmd + C(Mac) to copy the cells. - Open your destination application (e.g., Notepad, Word, or a new Excel sheet).
- Press
Ctrl + V(Windows) orCmd + V(Mac) to paste. If pasting into another Excel sheet, right-click and select Paste Values to ensure the formulas remain as text and do not try to calculate based on the new sheet's cell references. - Return to the original sheet and click Show Formulas again to return to the standard result view.
Method 2: Using the FORMULATEXT Function for Documentation
Use this method if you want to keep your results visible while having the formula written out in the cell immediately next to it.
- Insert a new blank column next to the column containing your formulas.
- Click into the first empty cell of the new column (for example, if your formula is in cell A2, click into B2).
- Type the following formula:
=FORMULATEXT(A2)and press Enter. - The cell will now display the exact text of the formula used in cell A2.
- Hover your mouse over the bottom-right corner of cell B2 until the cursor turns into a small black cross (the fill handle).
- Click and drag the fill handle down to the bottom of your data set to apply the function to all rows.
- To export these as permanent text, highlight the new column, copy it, and use Paste Values to remove the FORMULATEXT function and leave only the raw formula strings.
Method 3: The "Apostrophe Trick" for Quick Individual Exports
This is ideal for exporting one or two specific formulas without changing global settings.
- Select the cell containing the formula you want to export.
- Press
F2to enter Edit mode, or click into the Formula Bar at the top of the screen. - Place your cursor at the very beginning of the formula (before the equals sign).
- Type a single apostrophe (
'). - Press Enter.
- The cell now treats the formula as a text string. You can now copy this cell and paste it anywhere without Excel attempting to calculate it.
- To revert the cell back to a working formula, simply delete the apostrophe from the beginning of the string and press Enter.
Common Mistakes
One of the most frequent errors occurs when users copy formulas using "Show Formulas" and paste them directly into another Excel sheet using a standard paste. Because Excel sees an equals sign, it immediately tries to execute the formula. Since the cell references (like A1, B10) likely point to empty cells in the new sheet, the exported formulas will return 0 or #REF! errors. Always use Paste Values when moving formulas to a new sheet for documentation purposes.
Another mistake is forgetting to turn off "Show Formulas" mode. Users often find themselves confused when their spreadsheet suddenly looks "broken" or expanded, not realizing they have toggled the auditing view. Remember that this is a view setting, not a data change.
Some users attempt to export formulas by simply copying the cell in normal view. This copies the result of the calculation, not the logic. If you need the logic, you must use one of the methods outlined above.
Tips
For those managing massive workbooks with hundreds of formulas, creating a "Formula Map" is a best practice. Use the FORMULATEXT method on a dedicated "Documentation" tab. This allows you to audit your logic in one place without risking the integrity of your primary data entry sheets.
If you are exporting formulas to share with a developer or for a technical manual, pasting them into a plain text editor (like Notepad) is superior to Word. Word often applies "AutoCorrect" features, such as changing straight quotes to curly quotes or capitalizing the first letter of a formula (e.g., changing =sum to =Sum), which can make the formulas invalid if the recipient tries to copy them back into Excel.
To quickly identify which cells in a large sheet even contain formulas before you export, go to the Home tab, click Find & Select, and choose Formulas. Excel will highlight every cell that contains a calculation, allowing you to select and export only the necessary ranges.
Troubleshooting
The FORMULATEXT function returns #N/A: This happens if the cell you are referencing does not actually contain a formula (i.e., it contains a hard-coded number or text). Ensure the reference cell starts with an equals sign (=). If the cell looks like a formula but returns #N/A, check if the cell is formatted as "Text" instead of "General"; if it is, Excel treats the formula as a label and not a calculation.
The "Show Formulas" shortcut isn't working: Ensure your keyboard layout is set to English. On some international keyboards, the grave accent key is in a different location or requires a modifier key. If the shortcut fails, always use the ribbon path: Formulas > Show Formulas.
Pasted formulas are shifting references: If you copy a formula from A1 to B1, Excel automatically changes the reference from A1 to B1 (relative referencing). To prevent this during export, you must either export them as text (using the methods above) or change the original formulas to absolute references by adding dollar signs (e.g., changing A1 to $A$1) before copying.
Frequently Asked Questions
Can I export formulas to a CSV file?
Not directly. CSV files only store the resulting values of a cell. To export formulas to a CSV, you must first use the FORMULATEXT method or "Show Formulas" mode to convert the formulas into text strings, then save the file as a CSV.
Will exporting formulas remove my data?
No. Exporting formulas is a read-only process. Whether you are copying them to another app or using the FORMULATEXT function, your original data and calculations remain untouched.
Is there a way to export formulas using VBA?
Yes, you can write a macro that loops through all cells in a range and prints the .Formula property of each cell to a text file. This is recommended only for users comfortable with the Visual Basic Editor.
Why do my exported formulas look different in Google Sheets?
While most basic formulas are identical, some advanced Excel functions (like XLOOKUP or specific Array formulas) may have different syntax or behavior in Google Sheets. Always verify the logic after exporting across platforms.
Can I export formulas from a protected sheet?
If the sheet is protected and the formulas are marked as "Hidden," you will not be able to see them in the formula bar or via "Show Formulas." You must first unprotect the sheet using the password before you can export the logic.