Always work on a copy, not the original Before opening, renaming, or editing anything: copy your file to a safe location (a separate folder, a USB drive, or cloud storage). If an edit goes wrong, the copy is your only way back. Never make changes to your only version of the file. As you make edits, save incremental copies of each XML file you change (sheet1-v1.xml, sheet1-v2.xml) so you can step back to any point.
Check all worksheet files, not just sheet1.xml A workbook with three sheets has three worksheet files: sheet1.xml, sheet2.xml, sheet3.xml. Excel will report an error if any of them is corrupt. Apply the fixes below to every sheet file that shows a problem.

What a Healthy Worksheet XML File Looks Like

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
           xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <dimension ref="A1:E10"/>
  <sheetViews>
    <sheetView tabSelected="1" workbookViewId="0">
      <selection activeCell="A1" sqref="A1"/>
    </sheetView>
  </sheetViews>
  <sheetData>

    <row r="1" spans="1:5">                         <!-- row numbers must be ascending -->
      <c r="A1" t="s" s="1"><v>0</v></c>            <!-- t="s": shared string index -->
      <c r="B1" t="s" s="1"><v>1</v></c>
      <c r="C1" s="1"><v>12500</v></c>              <!-- plain number -->
    </row>

    <row r="2" spans="1:5">
      <c r="A2" t="s"><v>5</v></c>
      <c r="C2"><v>9200</v></c>
      <c r="D2"><f>C2*1.1</f><v>10120</v></c>       <!-- formula + cached value -->
    </row>

  </sheetData>
  <pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5"/>
</worksheet>

Key rules for a valid sheet:

  • Row r values must be in ascending order
  • Cell r values must be valid Excel addresses (column letters then row number)
  • All opened tags must be closed
  • t="s" cells point to sharedStrings indexes, not literal values
📄
CLEAN-sample-workbook.xlsx Clean Reference
A valid XLSX workbook — open, unzip, and inspect this file as a working reference while following the examples above.
Download

Type 1

Invalid Cell Address

The r attribute on <c> must be a valid Excel address. Missing, reversed, or duplicate addresses cause Excel to drop the cell.

Excel error message
Repaired Records: Cell information from /xl/worksheets/sheet1.xml part
<c r=""><v>9200</v></c>          <!-- ← CORRUPT: empty address -->
<c r="3C"><v>9200</v></c>        <!-- ← CORRUPT: reversed format, should be C3 -->
<c r="A1"><v>100</v></c>
<c r="A1"><v>200</v></c>         <!-- ← CORRUPT: duplicate address -->

Fix: Correct the address format to standard notation (column letters then row number). Remove duplicate cell entries, keeping the one with the correct value.

<!-- Fixed -->
<c r="C3"><v>9200</v></c>
<c r="A1"><v>100</v></c>
📄
CORRUPT-sheet-invalid-cell-address.xlsx Corrupt Example
Contains cells with an empty r attribute, a reversed address (3C instead of C3), and a duplicate A1. Excel drops the affected cells on repair.
Download
Type 2

Rows Out of Order

<row> elements in <sheetData> must appear in ascending order by r value. Some third-party tools write rows out of order.

<sheetData>
  <row r="1" spans="1:5">...</row>
  <row r="3" spans="1:5">...</row>   <!-- ← CORRUPT: row 3 before row 2 -->
  <row r="2" spans="1:5">...</row>
  <row r="4" spans="1:5">...</row>
</sheetData>

What you will see: Excel may open the file but display data in wrong rows, or prompt for repair and discard the out-of-order rows entirely.

Fix: Reorder the <row> blocks so r values are ascending. In VS Code, cut and paste the blocks into the correct sequence.

<!-- Fixed -->
<sheetData>
  <row r="1" spans="1:5">...</row>
  <row r="2" spans="1:5">...</row>
  <row r="3" spans="1:5">...</row>
  <row r="4" spans="1:5">...</row>
</sheetData>
📄
CORRUPT-sheet-rows-out-of-order.xlsx Corrupt Example
Row 3 appears before row 2 in sheetData. Excel may display data in wrong rows or discard the out-of-order rows entirely.
Download
Type 3

Broken Formula Tag

A cell with a formula contains both <f> (the formula) and <v> (the last calculated value). Corruption takes two forms: a malformed formula, or a formula referencing something that no longer exists.

<c r="E2"><f>SUM(C2:D2</f><v>0</v></c>          <!-- ← unclosed function call -->
<c r="E3"><f></f><v>0</v></c>                    <!-- ← empty formula tag -->
<c r="E4"><f>DeletedSheet!A1+B2</f><v>0</v></c>  <!-- ← deleted sheet reference -->

What you will see: #REF!, #NAME?, or 0 in those cells.

Fix: For a formula you cannot reconstruct, remove the <f> element entirely and leave just <v> with the last known value. The cell will no longer recalculate but will display the preserved data.

<!-- Fixed: removed broken <f>, kept last known value -->
<c r="E2"><v>26300</v></c>
<c r="E3"><v>18950</v></c>
📄
CORRUPT-sheet-broken-formula.xlsx Corrupt Example
Contains an unclosed SUM(), an empty <f> tag, and a reference to a deleted sheet. Affected cells show #REF! or 0.
Download
Type 4

Invalid Merge Cell Definition

Merged cells are defined in a <mergeCells> block separate from the row data. Overlapping ranges, malformed range references, or a wrong count attribute all trigger a repair.

Excel error message
Repaired Records: Merge cell information from /xl/worksheets/sheet1.xml
<mergeCells count="3">
  <mergeCell ref="A1:C1"/>
  <mergeCell ref="B1:D1"/>   <!-- ← CORRUPT: overlaps with A1:C1 -->
  <mergeCell ref="E1:"/>     <!-- ← CORRUPT: missing end of range -->
</mergeCells>

Fix: Remove overlapping or malformed entries. Update count to match the number of valid <mergeCell> entries that remain.

<!-- Fixed -->
<mergeCells count="1">
  <mergeCell ref="A1:C1"/>
</mergeCells>
📄
CORRUPT-sheet-invalid-merge-cells.xlsx Corrupt Example
Two merge ranges overlap, and one has a malformed ref (E1: with no end). Excel removes the invalid entries on repair.
Download
Type 5

Orphaned Tag — Unclosed Element

An unclosed tag anywhere in the file breaks XML parsing for everything that follows it. In a large sheet, one missing </c> can make thousands of rows of data unreadable.

<row r="4" spans="1:5">
  <c r="A4" t="s"><v>7</v></c>
  <c r="B4" t="s"><v>15</v>      <!-- ← CORRUPT: missing </c> -->
  <c r="C4"><v>15600</v></c>
  <c r="D4"><v>16200</v></c>
</row>

Fix: Add the missing closing tag.

<!-- Fixed -->
<c r="B4" t="s"><v>15</v></c>   <!-- added </c> -->
VS Code with red squiggles on the orphaned unclosed tag and XML error count in status bar
📄
CORRUPT-sheet-orphaned-tag.xlsx Corrupt Example
A missing </c> closing tag breaks XML parsing for all rows that follow it in the sheet.
Download

Using VS Code to Validate Large Sheet Files

For large files, VS Code's XML extension is far faster than reading line by line. It validates the entire document and highlights every problem at once.

  1. Install the XML extension by Red Hat (free, in the Extensions marketplace)
  2. Open your extracted sheet1.xml
  3. Open the Problems panel: View > Problems
  4. Every structural error is listed with a line and column number
Work from top to bottom Fixing an early error often makes several later ones disappear; they were cascading from the first broken tag. Always start from line 1 and work down.
VS Code Problems panel listing all XML parse errors with file name, line number and column

Checklist: How to Check sheet1.xml in Your File

  • Rename your XLSX to .zip, navigate to xl/worksheets/, and check how many sheet files exist (sheet1.xml, sheet2.xml, etc.); copy each one to your Desktop to inspect
  • Open in VS Code (with the Red Hat XML extension) and press Shift+Alt+F to format
  • Check the Problems panel for any red errors
  • Verify row r values appear in ascending order
  • Look for any <c> elements with an empty or reversed r attribute
  • Check the <mergeCells count=""> value matches the actual number of <mergeCell> entries
  • If you see formulas showing 0, check the <f> tags for unclosed parentheses or missing sheet references