Command-line helper that compares two .xlsx / .xlsm workbooks as normalized row multisets by reading the Open XML data directly.
Row order is ignored, but duplicate row counts are preserved.
The tool is intentionally generic. It does not know about a specific file type or row marker.
It compares worksheet cell values from the Open XML sheetData entries, resolving shared strings and inline strings.
Styles, column widths, workbook metadata, and formatting-only differences are ignored.
- .NET 10 SDK for building, testing, and publishing.
- .NET 10 runtime when running a framework-dependent build.
- No Microsoft Excel installation is required. The tool reads the workbook package directly.
src/ExcelMultisetComparer/ Application source
tests/ExcelMultisetComparer.Tests/ Unit tests
ExcelMultisetComparison.slnx Solution file
From the repository root, build the solution:
dotnet build ExcelMultisetComparison.slnx -c ReleaseFor a Debug build, omit -c Release:
dotnet build ExcelMultisetComparison.slnxRun the unit tests from the repository root:
dotnet test ExcelMultisetComparison.slnxPublish a self-contained single-file executable for the target operating system.
Windows x64:
dotnet publish src/ExcelMultisetComparer/ExcelMultisetComparer.csproj -c Release -r win-x64 -p:PublishSingleFile=true --self-contained trueLinux x64:
dotnet publish src/ExcelMultisetComparer/ExcelMultisetComparer.csproj -c Release -r linux-x64 -p:PublishSingleFile=true --self-contained truemacOS Apple Silicon:
dotnet publish src/ExcelMultisetComparer/ExcelMultisetComparer.csproj -c Release -r osx-arm64 -p:PublishSingleFile=true --self-contained trueThe published executable is written below:
src/ExcelMultisetComparer/bin/Release/net10.0/<runtime-identifier>/publish/
Use --self-contained false if the target machine already has the required .NET runtime installed and you prefer a smaller framework-dependent output.
Run without publishing:
dotnet run --project src/ExcelMultisetComparer/ExcelMultisetComparer.csproj -- --left old.xlsx --right new.xlsxRun a published executable on Windows:
ExcelMultisetComparer.exe --left old.xlsx --right new.xlsxRun a published executable on Linux or macOS:
./ExcelMultisetComparer --left old.xlsx --right new.xlsxExcelMultisetComparer.exe --left old.xlsx --right new.xlsxUseful options:
| Parameter | Description | Default |
|---|---|---|
--left, -l |
Left Excel file. | Required |
--right, -r |
Right Excel file. | Required |
--sheet, -s |
Compare only one worksheet by name. | All sheets |
--skipRows |
Skip rows from the top of each used worksheet range. | 0 |
--firstCellEquals |
Compare only rows whose normalized column A value equals the given value. | Disabled |
--caseInsensitive |
Compare values case-insensitively. | false |
--preserveWhitespace |
Keep leading and trailing whitespace. | Trimmed |
--includeEmptyRows |
Include empty rows that are present in the worksheet XML. | Ignored |
--sampleSize |
Number of distinct differences printed per side. | 10 |
ExcelMultisetComparer.exe --left old.xlsx --right new.xlsx
ExcelMultisetComparer.exe -l old.xlsx -r new.xlsx --sheet Worksheet1 --firstCellEquals DoB| Code | Meaning |
|---|---|
0 |
Equal as normalized multisets. |
1 |
Differences found. |
2 |
Invalid arguments or comparison error. |