# Merge and Compare Excel Workbooks

Merge and Compare Excel Workbooks on Evotec with installation guidance, setup notes, reference details, and project documentation.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice)

Stars**750**

Forks**87**

Open issues**10**

PowerShell Gallery downloads**5557794**

Release**v3.6.2**

Language: C# Updated: 2026-11-29

Documentation

Consolidate selected worksheets and produce explicit workbook or range differences for review and delivery gates.

Workbook consolidation and workbook comparison solve different problems. Joining copies selected sheets into a target workbook. Comparing reports how two workbooks differ without combining them.

## Consolidate selected sheets

```powershell
Join-OfficeExcelWorkbook -Path '.\Consolidated.xlsx' `
    -SourcePath '.\Regions.xlsx' `
    -SourceSheet North,South `
    -SheetNamePrefix 'Region '
```

Use a stable prefix when sources can contain the same sheet names. Copy mode and name-validation options let the operation match the preservation and naming policy.

## Compare a candidate

`Compare-OfficeExcelWorkbook` checks cells, styles, named ranges, tables, worksheet metadata, and comments. Skip categories only when the delivery contract says they do not matter. `Compare-OfficeExcelRange` narrows the comparison to a known business area.

The [merge-workbooks recipe](https://github.com/EvotecIT/PSWriteOffice/blob/main/Examples/Excel/Recipe-Excel-MergeWorkbooks.ps1) consolidates two regional sheets. The [compare-workbooks recipe](https://github.com/EvotecIT/PSWriteOffice/blob/main/Examples/Excel/Recipe-Excel-CompareWorkbooks.ps1) creates a controlled cell difference and reports it.

After a merge, run the checks described in [validation and repair](/projects/pswriteoffice/docs/excel-validation-repair/).

<!-- PowerForge markdown artifact sha256:DE1B126282DE25D86022FEF4C255FAE07760EE80BC38C7082D1542F57553505B -->
