Excel file is corrupted on Mac: what you can recover
When Excel for Mac reports that a workbook is corrupted, the cell values are usually still inside the file; it is the packaging around them that broke. An .xlsx is a ZIP archive of XML sheets, and the realistic recovery order is: values first, then formulas and formatting, then charts, with macros and external links the least likely to survive. Below are the steps, from the gentle ones to the ones that take the file apart.
What usually survives and what usually does not
It helps to know what you are fighting for before you start.
- Cell values and text: almost always recoverable. Numbers live in the sheet XML; text lives in a shared strings table. Both are plain XML and both can be read even when Excel refuses the whole file.
- Formulas: usually recoverable, because each is stored as text next to its cached result.
- Formatting, column widths, merged cells: often recoverable if the styles part is intact, lost if it is not. Your numbers come back but look plain.
- Charts, pivot tables, data validation: fragile. They reference other parts of the archive and break when those parts are missing.
- Macros (.xlsm): the VBA project is one binary blob; it either comes back whole or not at all.
- Links to other workbooks: often the original cause of the trouble, and rarely worth saving.
Duplicate the file in Finder (Command+D) before you try anything, and work on the copy.
Step 1: check Excel’s AutoRecovery folder first
Excel for Mac saves recovery copies every ten minutes by default. If the corruption happened during a crash or a forced quit, the best version of your workbook may already be sitting on disk.
- In Finder, press Command+Shift+G.
- Paste
~/Library/Containers/com.microsoft.Excel/Data/Library/Application Support/Microsoft/Office/Office AutoRecoveryand press Return. - Sort by Date Modified and open anything from the right time.
Also check the Recovered files Excel sometimes lists in the Open dialog after a crash, and any cloud folder’s version history if the file lived in iCloud Drive or a sync folder.
Step 2: open it with Numbers
Numbers uses its own parser and is considerably more tolerant of a damaged workbook than Excel.
- Right-click the .xlsx in Finder, choose Open With, then Numbers.
- If it opens, look at every sheet tab and spot-check totals against what you remember.
- Choose File, Export To, Excel to write a fresh .xlsx.
Numbers drops some Excel features (certain functions, pivot tables, macros) and will tell you what it left out. For a workbook you mainly need the data from, that is a fair trade.
You can also try Excel’s own web version, which uses a different code path and sometimes opens what the desktop app will not. That does mean uploading the file.
Step 3: confirm what the file actually is
Open Terminal and run:
file ~/Desktop/budget.xlsx
“Microsoft Excel 2007+” is what you want. “Composite Document File V2” means it is an old .xls that someone renamed; change the extension back and Excel will open it. “CSV text” or “ASCII text” means it was exported as plain text with the wrong extension; rename to .csv. “data” with nothing else means the ZIP header is gone, which usually means a truncated copy. Check the size in Get Info. A workbook that should be 2 MB and is 40 KB was cut short during a transfer, and only the first part of the data is inside.
Step 4: take the archive apart
Everything in an .xlsx can be inspected with tools that ship with macOS.
- Test the container:
unzip -t ~/Desktop/budget.xlsx
Entries marked OK are intact. An “End-of-central-directory” error means the index at the end of the file is missing, which unzip can often work around anyway.
- Extract whatever can be read:
mkdir ~/Desktop/budget-parts && cd ~/Desktop/budget-parts
unzip ../budget.xlsx
-
Look in
xl/worksheets. Each sheet issheet1.xml,sheet2.xmland so on.xl/sharedStrings.xmlholds every piece of text in the workbook.xl/workbook.xmlmaps sheet names to those numbers. -
If all the parts are present, re-zip from inside the folder and try Excel again:
zip -r -X ../budget-fixed.xlsx .
Re-zipping alone fixes a surprising share of “corrupted” workbooks, because the original problem was a damaged index rather than damaged data.
Get the values out when the workbook will not rebuild
If Excel rejects even the re-zipped file, read the data straight out of the XML. Numbers in a sheet appear as <v>1234.5</v> inside <c> cells; a cell with t="s" holds an index into the shared strings table rather than the text itself. A quick way to see the numbers of one sheet:
grep -o '<v>[^<]*</v>' xl/worksheets/sheet1.xml | sed 's/<[^>]*>//g' > ~/Desktop/sheet1-values.txt
And the text:
sed 's/<[^>]*>/\n/g' xl/sharedStrings.xml | grep -v '^$' > ~/Desktop/strings.txt
This loses the grid layout, so it is a last resort for a workbook where a few hundred values matter more than their positions. For a large model it is better to keep working on the container.
Step 5: let Manatee rebuild the container
Manatee handles the Step 4 work in one drop. Drag the .xlsx onto its menu bar icon or into its window, choose Repair, and it reads the archive entry by entry, keeps every part it can verify, and writes a new workbook beside the original. The original is never modified.
The outcome is reported plainly: Fixed when Excel opens the new copy cleanly, Partial when some parts could not be recovered (you see which), and Not fixable when nothing readable remains. Manatee does not rebuild formulas that were never saved, does not recover a workbook you deleted, and does not open a password-protected file without the password. It runs entirely on your Mac, with no upload, which matters when the workbook is your payroll or your client list. It is free for 24 hours with every feature, then $9 once.
The same approach applies to other Office containers; see how to repair a PowerPoint file that won’t open on Mac and fixing a DOCX that Word says is corrupt. For how partial outcomes are reported, read partial recovery explained.
Preventing the next one
Most corrupted workbooks are a save that did not finish. Save before ejecting a drive, wait for cloud sync to settle before moving a file, avoid editing the same workbook on two machines at once, and use File, Save a Copy to a second location for anything that took more than a day to build. If a workbook regularly refuses to open, check whether it links to other files on a drive that is no longer connected; broken external links are a common trigger.
Questions
Excel opens the file but some cells show #REF or #NAME errors. Is that corruption? Usually not. #REF means a referenced range no longer exists, often because a linked workbook or sheet is missing. #NAME means a function Excel for Mac does not recognize, common after a file comes from a newer Windows version. Neither is a damaged file, just a broken reference.
Can the macros be saved?
Only if xl/vbaProject.bin extracts intact in Step 4. If it does, re-zipping will carry it along. If it is damaged, the code is gone and must be re-created from a backup or from memory.
The file opens in Numbers but a sheet is empty. Why? That sheet’s XML was likely the damaged part, while the others were fine. Extract the archive and look at the size of that sheet’s file; if it is a few hundred bytes, the data did not survive and you will need an earlier version.
Will repairing a .xlsx preserve the formatting?
If xl/styles.xml is intact, yes. If that part was lost, the values come back unformatted. Number formats, colors and column widths are quick to restore by hand once the data is safe.