# A project workbook with a summary

Build an Excel project workbook in C# with detail and summary sheets, cross-sheet formulas, and a filterable delivery table. Download the XLSX.

Excel · C# walkthrough

Let one worksheet own the detailed numbers while a second presents the review view. This workbook demonstrates cross-sheet references without manually copying the same figures into two places.

[Build this report](#example-code)[Download XLSX](/downloads/showcase/workflows/excel-project-workbook/example.xlsx) [Try this file in your browser](/browser/excel-to-pdf/)

Opens the generated download in a local browser tool. The C# example below creates the document.

**Start with**

Planned and used days by workstream

**Generate**

XLSX

[!\[Generated Excel example: A project workbook with a summary\](/downloads/showcase/workflows/excel-project-workbook/preview.webp)](/downloads/showcase/workflows/excel-project-workbook/preview.png)

Generated worksheet · Generated by the example below

## How it works

1. ### Separate detail from presentation
  
  Create Summary first for the opening view, and Delivery for the data table.
2. ### Calculate in the owning sheet
  
  Compute remaining days beside each delivery row, then point the summary formulas at those cells.
3. ### Keep the detail usable
  
  Add a table and freeze its heading row. Calculate before creating the summary image and saving the workbook.

## The C# source

The example below shows the document API and layout used for this report. Follow the Excel guide for package setup in your own project.

```csharp
using OfficeIMO.Drawing;
using OfficeIMO.Excel;

namespace OfficeIMO.Examples.Showcase.Workflows;

/// <summary>Separates delivery detail from a summary with cross-sheet formulas.</summary>
internal static class ProjectWorkbook {
    internal static void Create(string folder) {
        using ExcelDocument document = ExcelDocument.Create(Path.Combine(folder, "example.xlsx"));
        ExcelSheet summary = document.AddSheet("Summary");
        ExcelSheet delivery = document.AddSheet("Delivery");
        summary.Range("A1:D1").Merge();
        summary.Cell(1, 1).SetValue("Project workbook / weekly delivery");
        summary.Cell(1, 1).SetFontSize(global::OfficeIMO.OfficeLength.Points(20));
        summary.Cell(1, 1).SetBold(true);
        summary.Cell(1, 1).SetColor(OfficeColor.Parse("17365D"));
        string[] labels = { "Discovery", "Build", "Pilot", "Handover" };
        string[] headers = { "Workstream", "Planned days", "Used days", "Remaining" };
        for (int column = 0; column < headers.Length; column++) {
            delivery.Cell(1, column + 1).SetValue(headers[column]);
            summary.Cell(4, column + 1).SetValue(headers[column]);
            summary.Cell(4, column + 1).SetFillColor(OfficeColor.Parse("17365D"));
            summary.Cell(4, column + 1).SetColor(OfficeColor.Parse("FFFFFF"));
            summary.SetColumnWidth(column + 1, ExcelColumnWidth.Characters(column == 0 ? 30 : 22));
            delivery.SetColumnWidth(column + 1, ExcelColumnWidth.Characters(column == 0 ? 30 : 22));
        }
        for (int index = 0; index < labels.Length; index++) {
            int row = index + 2;
            delivery.Cell(row, 1).SetValue(labels[index]);
            delivery.Cell(row, 2).SetValue(new[] { 12, 30, 10, 8 }[index]);
            delivery.Cell(row, 3).SetValue(new[] { 12, 18, 3, 0 }[index]);
            delivery.Cell(row, 4).SetFormula($"B{row}-C{row}");
            summary.Cell(index + 5, 1).SetValue(labels[index]);
            for (int column = 2; column <= 4; column++) {
                string letter = ((char)('A' + column - 1)).ToString();
                summary.Cell(index + 5, column).SetFormula($"'Delivery'!{letter}{row}");
            }
            summary.Cell(index + 5, 4).SetFillColor(OfficeColor.Parse("E7F6ED"));
        }
        delivery.AddTable("A1:D5", true, "DeliveryPlan", ExcelTableStyle.TableStyleMedium2);
        delivery.View.Freeze(topRows: 1);
        summary.Range("A11:D11").Merge();
        summary.Cell(11, 1).SetValue("Edit the Delivery sheet; Summary references the same values.");
        document.Calculate();
        summary.Range("A1:D13").ToImage(OfficeImageExportFormat.Png)
            .Save(Path.Combine(folder, "preview.png"), OfficeImageExportFileConflictPolicy.Replace);
        document.Save();
    }
}
```

[Open the C# source file](/downloads/showcase/workflows/excel-project-workbook/ProjectWorkbook.cs.txt)

## API used in this example

- [`OfficeColor`](/api/core/officeimo-officecolor/)
- [`ExcelColumnWidth`](/api/excel/officeimo-excel-excelcolumnwidth/)
- [`ExcelDocument`](/api/excel/officeimo-excel-exceldocument/)
- [`ExcelSheet`](/api/excel/officeimo-excel-excelsheet/)
- [`ExcelTableStyle`](/api/excel/officeimo-excel-exceltablestyle/)
- [`OfficeImageExportFileConflictPolicy`](/api/core/officeimo-drawing-officeimageexportfileconflictpolicy/)
- [`OfficeImageExportFormat`](/api/core/officeimo-drawing-officeimageexportformat/)
- [`OfficeLength`](/api/core/officeimo-officelength/)

## Use this in your project

Add workstreams to the detail sheet and extend the corresponding summary references. The sample remaining-day values are 0, 12, 7, and 8.

The [Excel guide](/docs/excel/) explains package setup and related document APIs.

## Documents and scope

### What the preview shows

The linked C# example generates this file. The runner reopens and validates the XLSX. The image is a native rendering of the specified worksheet range.

### What to keep in mind

The image shows the Summary sheet. Open the XLSX to inspect and edit Delivery; the preview is not an interactive workbook.

[Excel API reference](/api/excel/) · [Artifact hashes and provenance](/downloads/showcase/manifest.json)

## Continue with another example

- [Excel**Budget scenario comparison**](/showcase/excel-budget-scenarios/)
- [Word**Project charter**](/showcase/word-project-charter/)
- [PowerPoint**An editable project roadmap deck**](/showcase/powerpoint-project-roadmap/)

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