If Excel says a file format or file extension is not valid, first check that the file finished downloading and that its extension matches its actual format; do not simply rename it and hope for the best. If the file is a genuine Excel workbook but may be damaged, try Excel for Windows’ Open and Repair command, then recover a copy from version history or a backup if needed.
What the error means
The message usually means Excel cannot reconcile the file’s contents with the format it expects. For example, a file named budget.xlsx should contain an Excel workbook in the modern Office format. If it instead contains plain text, a web page, or incomplete data, changing the name does not turn it into a valid workbook.
Excel may show wording such as “The file format and extension of [filename] don’t match” or “The file format is not valid.” The precise message varies with the Excel version and the problem. These errors are not all proof that the workbook is permanently lost: a mismatched extension, interrupted transfer, or incompatible format can produce a similar result to actual corruption.
Keep an untouched copy of the original before trying repairs. Some actions, such as saving under a different format, can remove features or overwrite recoverable data. Work on a duplicate whenever possible.
Common reasons Excel rejects a file
Start with the simplest explanations. A file can look like an Excel workbook in File Explorer or Finder while its contents tell a different story. Common causes include:
- The extension is wrong. A CSV, HTML page, or older Excel file may have been given an
.xlsxname. This can happen after manual renaming or when another application exports a file. - The download or transfer was incomplete. A browser interruption, email attachment problem, cloud-sync delay, or network disconnect can leave a file too small or incomplete to open.
- The workbook is damaged. A crash during saving, a failing storage device, or a disrupted copy can damage parts of the workbook package.
- The file is not really an Excel workbook. A web download may have saved an error page or sign-in page instead of the requested document. The filename can still end in
.xlsx. - The format is too old or unsupported in the installed software. A very old Excel format may need a compatible version or conversion before a current workflow can use it.
- A security or access issue is involved. A password, restricted location, or organization policy can prevent access, although those issues usually produce a more specific prompt than a format error.
File size is a useful clue, not a verdict. A zero-byte file is clearly incomplete, but a small workbook can be legitimate. Likewise, a large file is not necessarily healthy.
Check the file type before changing anything
Confirm the full filename and extension. In Windows 11 File Explorer, select View > Show > File name extensions. In macOS Finder, open Finder > Settings > Advanced and enable Show all filename extensions. This helps reveal a name such as report.xlsx.csv or an extension hidden by the operating system.
Then ask where the file came from and what it should contain. If it came from a website, download it again using the site’s official download control and check that the browser completed the transfer. If it came from email or cloud storage, save a fresh copy to a local folder and wait for synchronization to finish. Compare the new copy’s file size with the original when possible.
Do not treat an extension change as a repair. Renaming report.csv to report.xlsx does not convert comma-separated text into an Excel workbook. If you know the file is actually a CSV, open Excel and import it with Data > From Text/CSV, then review the preview and choose Load. If it is a tab-delimited or other text file, use the appropriate delimiter in the import preview rather than guessing.
For an unfamiliar attachment, verify the sender and request a fresh export in a known format. Do not enable macros, bypass security warnings, or upload a confidential workbook to an unknown online repair site just to test whether it opens.
Try these fixes in a safe order
Use this sequence, stopping when the file opens correctly:
- Make a copy. Put the original aside and use a duplicate for troubleshooting.
- Download or copy it again. Obtain a new copy from the original sender, website, email, or cloud location. If the file was on a network drive, copy it to a local folder first.
- Confirm the intended format. Ask the sender what program created it and whether it should be an
.xlsx,.xls,.xlsm, or text file. An.xlsmfile is an Excel workbook that can contain macros; do not rename it to.xlsxto remove a warning. - Open it from Excel. In Excel for Microsoft 365 on Windows, choose File > Open > Browse, select the file, and use the arrow beside Open to choose Open and Repair if that option is available.
- Try another trusted copy or compatible Excel installation. A file that opens on another computer may point to a local application or version issue; a file that fails everywhere is more likely incomplete, mismatched, or damaged.
For Excel on Mac, use File > Open to select the file; the Windows Browse and Open and Repair instructions do not apply in the same way. If the Mac version cannot open it, request a fresh copy or try a trusted Windows desktop copy of Excel for the repair option. Excel for the web can be useful for a healthy supported workbook, but it is not a guaranteed repair tool for a damaged file.
Use Open and Repair for a damaged workbook
In desktop Excel for Windows, Open and Repair is designed to attempt recovery when Excel can identify the file as a workbook but has trouble reading it. In the Open dialog, select the file, open the menu attached to the Open button, and choose Open and Repair. If Excel offers a choice, try Repair first. If that does not work, repeat the process and choose Extract Data to try to retrieve values and formulas.
Recovery can be partial. Formatting, charts, links, macros, or some formulas may be lost, and extracted data may not preserve the workbook’s layout. Save any recovered version under a new filename and inspect important sheets, totals, formulas, and dates before relying on it. Keep the original unchanged in case another recovery method works better.
If Excel never offers the repair option or reports that the file type is unsupported, go back to confirming the source and actual format. Repair is not a way to convert every file type, decrypt a password-protected workbook, or make a deliberately renamed text file into an Excel document.
Recover another copy or an earlier version
When repair fails, finding a clean earlier copy is often safer than repeatedly modifying the damaged one. Check the source location and any system your organization uses for backups. If the workbook is stored in OneDrive or SharePoint, look for its version history and restore or download a previous version. Restoring an earlier version may replace the current one, so download a copy first when that option is available.
For a workbook saved on your computer, check Windows File History or another backup service if it was configured. Excel’s unsaved-workbook recovery is mainly relevant when Excel closed unexpectedly before a save; it is not a general solution for every corrupted file. In Excel for Windows, check File > Info for available workbook management or recovery options, noting that what appears depends on the file and Excel setup.
If the file is important and no backup exists, preserve the original and seek help from your organization’s IT team or the file’s creator before using third-party recovery software. Recovery tools vary in capability and may expose sensitive data, so check their source, privacy terms, and organizational rules.
Formats, compatibility, and security
Excel formats are not interchangeable labels. The common .xlsx format is the modern Excel workbook format and does not store VBA macros. .xlsm supports macro-enabled workbooks, while the older .xls format is associated with earlier Excel versions. CSV files store tabular text, usually one sheet at a time, rather than the full workbook features found in Excel formats. Saving a workbook as CSV can discard other sheets, formatting, and features.
Excel for Microsoft 365 generally supports these common formats, but older software or a specialized export may have limitations. If a sender used an unusual or legacy program, ask them to export a standard Excel workbook or a clearly identified text format. If a format conversion is necessary, keep the original and review the converted result for missing sheets, formulas, and formatting.
A mismatch warning also has a security purpose: a file extension alone cannot prove what a file contains. Only open files from sources you trust, and avoid changing a suspicious attachment’s extension to suppress a warning. If the file is legitimate but mislabeled, get a corrected export from its creator rather than weakening security settings.
Frequently Asked Questions
Can I fix the error by changing .xlsx to .xls?
No. Renaming changes the filename, not the file’s internal structure. Use a format conversion in a program that can open the file, or ask its creator to export it in a compatible format. Changing an extension blindly can make the file harder to identify.
Why does Excel say the format is invalid when the file looks normal?
The filename and icon do not verify the contents. A download might be incomplete, or a website may have supplied an error page instead of the workbook. Check the source, download it again, and confirm the intended file type.
Will Open and Repair restore everything?
Not always. It may recover the workbook, extract only some data, or fail. Even a file that opens after repair can be missing formulas, formatting, charts, or macros, so compare its contents with a backup or the sender’s copy.
Is a CSV file an Excel workbook?
No. Excel can open and edit CSV data, but CSV is plain text and does not preserve workbook features such as multiple sheets, formatting, and formulas as Excel formulas. Import it through Data > From Text/CSV when you need to control how Excel reads its columns.
What should I do if the file opens on another computer?
Make a safe copy, then compare Excel versions and how the file was transferred or stored. A fresh local copy may help if a sync or network transfer was incomplete. If the problem remains limited to one computer, ask IT to check its Office installation and access policies.
Related
- Identify Circular References in Excel: A Step-by-Step Guide
- Enable Circular References in Excel: Step-by-Step
- Find Circular References in Excel
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- Excel Freeze Panes Not Freezing Selection? Fix ItExcel Freeze Panes does not lock the cell or range you select; it keeps the rows above and…
- Standard Error in Excel: How to Calculate ItTo find the standard error of the mean in Excel, divide the sample standard deviation by the square…
- Excel Date Format Won’t Change? Causes and Fixes GuideIf Excel date format won’t change, the cell may contain text instead of a real date, or a…
- Excel Map Not Working? Fix the Most Common CausesIf an Excel map is blank, inaccurate, or unavailable, first check that your location data is clear and…
- Excel Error Message When Opening a File: Causes and FixesAn Excel error message when opening a file usually means Excel cannot read the file as presented, the…
- VLOOKUP Not Working? Fix Common Excel Lookup ErrorsIf VLOOKUP is not working in Excel, first set its final argument to FALSE for an exact match,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.