You can use MergeCells and MergeCell to create the merged cells that you require. The MergeCells class represents a set of merge cells ( <mergeCells count="3"> in your XML), and the MergeCell class represents each separate set of merged cells ( <mergeCell ref="xx:xx" /> in your XML). To fill in the data in the merged cells, you need to add a value to the upper left of the cell; any other values will be ignored.
The following code will create a new file with merged cells.
using (SpreadsheetDocument myDoc = SpreadsheetDocument.Create(filename, SpreadsheetDocumentType.Workbook)) { WorkbookPart workbookpart = myDoc.AddWorkbookPart(); workbookpart.Workbook = new Workbook();
The above code creates:

petelids
source share