Fix Excel 365 Removing a Custom Number Format and Repairing styles.xml
Question details
Find out why Excel 365 repairs a workbook's style information and removes a custom number format when the file is reopened.

- Product
- Microsoft Excel 365
- Device & OS
- not provided
- Scenario
- A workbook uses a custom number format such as #,##0 ;(#,##0) and is saved and reopened in Excel.
- Observed behavior
- Excel reports a repair to xl/styles.xml and removes the custom number format.
Keep an untouched copy of the workbook before opening it for repair, since Excel may remove formatting during recovery. Note the exact custom format and which cells use it so you can recreate it.
Repair the workbook and recreate the custom number format
Use this approach when Excel opens the workbook after reporting a styles.xml repair.
The repair may involve other style definitions, so the custom format itself is not necessarily the cause.
In desktop Excel, choose File > Open and open a copy of the affected workbook. If Excel reports a repair, review the repair message or log for references to styles.
Choose File > Save As and save the repaired workbook under a new name in Excel Workbook (.xlsx) format.
Select the affected cells, right-click and choose Format Cells > Number > Custom. Enter the required format, such as #,##0 ;(#,##0), in the Type box and select OK.
Save the file, close it, and reopen it in Excel. Check whether the custom format remains and whether Excel reports another repair.

Isolate the source or move data to a new workbook
Use this if the repaired copy still loses its custom format when reopened.
Work with spreadsheet number formats in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. It opens and saves Excel-compatible files, making it easy to move everyday spreadsheet work to WPS; it does not repair Excel's own styles.xml issue.

Frequently Asked Questions
Does a styles.xml repair mean my custom format is invalid?
Not necessarily. Excel may repair other malformed or incompatible style information in the workbook. Recreate the format through Format Cells > Number > Custom, then save and reopen the file to test it.
Where can I find the removed number format in Excel?
Select an affected cell, right-click it, and choose Format Cells > Number > Custom. If the format was removed during repair, enter it again in the Type box.
How can I tell whether another application caused the repair?
Save separate test copies in current Excel and in the other application. Reopen each copy in Excel and compare whether the styles.xml repair occurs.
What is lost when I paste values into a new workbook?
Paste Special > Values transfers cell results without the original formulas or formatting. Recreate any required formulas and custom formats in the new workbook.




