How to Create a Sankey Diagram in Excel: 4 Methods

Although Microsoft Excel does not include a native Sankey chart type, there are several ways to create a Sankey diagram using Excel data. You can combine standard Excel charts, build a formula-driven visualization, use a dedicated Excel add-in, or import your data into standalone analytics software.

Each approach offers a different balance between technical complexity, flexibility, automation, and analytical capabilities. In this guide, we explore four practical methods for creating Sankey diagrams from Excel data, including two approaches that require neither add-ins nor VBA.

If you are new to flow visualization, our comprehensive Sankey diagram guide explains the underlying principles, visual components, and interpretation of Sankey diagrams.

Four Ways to Create a Sankey Diagram from Excel Data

  • Standard Excel Charts: Combine stacked area and column charts with traditional Excel formulas.
  • Advanced Excel Formulas: Calculate flow geometry using dynamic arrays and scatter charts.
  • Excel Sankey Add-in: Generate Sankey diagrams automatically within your Excel workflow.
  • Standalone Analytics Software: Import Excel data into a dedicated visualization and analytical environment.

The most suitable method depends on your dataset, technical requirements, and analytical objectives.

Preparing Excel Data for a Sankey Diagram

Before creating a Sankey diagram, organize your Excel data into a structure that describes relationships and their associated quantities. Two commonly used formats are source–target–value tables and multi-level datasets.

Source-Target-Value Format

Each row represents an individual connection between two categories or stages.

SourceTargetValue
OrganicDemo60
OrganicTrial40
PaidDemo20
PaidTrial80
DemoConverted80
TrialConverted40
TrialLost80

Multi-Level Format

Each row describes a complete sequence across multiple stages, together with its associated numerical weight.

ChannelInteractionOutcomeValue
OrganicDemoConverted60
OrganicTrialLost40
PaidDemoConverted20
PaidTrialConverted40
PaidTrialLost40

Both datasets produce the same aggregated Sankey diagram. However, the multi-level format also preserves the relationships between the sources, intermediate stages, and outcomes. Depending on the selected method, you may also need to transform these records into a source-to-target matrix or create additional calculation tables.

For a detailed explanation, see our Sankey Diagram Data Structure guide.

Method 1: Create a Sankey Diagram in Excel Using Standard Charts

A Sankey diagram can be constructed entirely within Excel by combining standard chart types with traditional spreadsheet formulas. This method requires no add-ins, VBA, LAMBDA functions, or dynamic arrays.

While the easiest way to build a Sankey diagram is by using an add-in, sometimes you might want – or need – to do it manually. If you’re unable to install add-ins, or if you need full control over every visual detail, the following section shows you how to create a Sankey diagram manually using only Excel’s built-in tools.

Sankey diagram is one of the best visualization tools in Excel. Whether you’re working in a restricted environment or want full control over the visuals, this guide walks you through a completely add-in-free method using only native Excel tools. We’ll use basic shapes, connectors, and formatting techniques to replicate the flow-based structure typical of a Sankey diagram. It takes a bit more effort, but it’s a valuable skill when automation isn’t an option.

The trick is to build multiple charts and merge them into a final diagram. You can build a diagram by making the shaded lines partially transparent and overlapping. Use 100% stacked area charts for the connectors, and 100% stacked column charts for the start and end blocks. We will show you how to transform a sales table into a diagram.

While an add-in simplifies creating advanced visualizations with a few clicks, some users may be in environments where add-ins are restricted (such as corporate firewalls, locked-down IT systems, or shared workbooks). Others might want full control over customization, formatting, or logic.

The manual method offers you the opportunity to:

  • Build the diagram from first principles
  • Understand exactly how the flows are positioned and calculated
  • Customize every visual detail with no reliance on automation

This is not only practical but also educational – it forces you to break down what makes a diagram work.

#1. Setting up the data

Start with a 4×4 matrix representing source-to-target relationships. Each row is a source (e.g., individuals), and each column is a destination (e.g., products or categories). The values show the quantity flowing from source to destination. We introduce a helper variable called Gap, which we use later to insert empty space between blocks in the diagram. This spacing is critical for improving visual readability and separating distinct categories.

From / ToAppleMelonKiwiBanana
John1,5003001,000200
Thomas1,0004001,000200
Robert2001,0005001,000
Peter1,5007001,5001,000

We have an additional field named range, Gap. We use these values to ensure spacing between categories.

#2. Create Calculation tables

To structure the diagram, we break it into three key components:

  • Lines Table: Each row represents a line between a “From” and “To” node. We also introduce synthetic rows (“Blank 1”, “Blank 2”, etc.) which add vertical spacing.
  • StartBlock Table: Sums the outbound flow from each source. This is used to construct the left-side blocks.
  • EndBlock Table: Sums the inbound flow to each destination. This creates the right-side blocks.

Named range:

Divider: A set of equally spaced values (0, 5, 90, 100) used to position each connector on the X-axis. This mimics a horizontal gradient across the chart.

Why we need these: Excel charts (especially stacked charts) require tidy, structured ranges with known positions. By flattening our matrix into row-column pairs and calculating gaps, we prepare the data for a stacked area and column representation.

Traditional Excel functions such as INDEX, MATCH, SUM and SUMIFS are sufficient for these calculations.

sankey diagram excel create calculation table

The values in the Lines table are linked to the original table. Let us see the formulas!

#3. Calculate Connector Metrics

Now we define how thick each connector line should be and where it should be positioned vertically.

Key calculations:

  • Value: Actual flow value (e.g., 1500 from John to Apple)
  • Above Start: Amount of space above this line, based on what’s already stacked above it
  • Below Start: Space below this line, so that total stack adds up correctly

Sample Formula (to retrieve flow value):

=IF(LEFT([@From],5)=”Blank”, Gap, INDEX(Data, MATCH([@From], Data[From / To], 0), MATCH([@To], Data[#Headers], 0)))

sankey diagram connector lines

This formula checks if the row is a ‘blank’ used for spacing. If not, it looks up the actual data intersection between “From” and “To” in the matrix. We also calculate multiple ‘middle’ values (Mid 1, Mid 2) to control the shape of the curve in the area chart. These define how the line arches from source to destination.

Example: Above Start

=SUM(Lines[[#Headers],[Value]]:[@Value]) – [@Value]

This finds the cumulative sum of all values above the current row and subtracts the current value to find the “space above.” This ensures lines stack correctly and don’t overlap. These formulas transform raw matrix data into positional chart logic, which is the key to building a usable chart representation.

Explanation:

  • Above Start: =SUM(Lines[[#Headers],[Value]]:[@Value])-[@Value] The formula returns a value and determines the blank area’s required size at the starting point.
  • Above Middle 1: =[@[Above Start]] The value is a simple cell reference from the AboveStart column.
  • Above Middle 2: =[@[Above End]] The value is a simple cell reference from the AboveEnd column.
  • Above End: =SUM([Value])-SUMIFS([Value],[End Position],”>=”&[@[End Position]]) The formula returns the required space above the Sankey line at the endpoint.
  • Start value, Middle 1, Middle 2, End Value =[@Value]
  • Below Start =SUM([Value])-[@[Above Start]]-[@Start]
  • Below Middle 1 =SUM([Value])-[@[Above Middle 1]]-[@[Middle 1 Value]]
  • Below Middle 2 =SUM([Value])-[@[Above Middle 2]]-[@[Middle 2 Value]]
  • Below End =SUM([Value])-[@[Above End]]-[@[End Value]]

The StartBlocks table collects each row category from the source table, and we apply a gap row for every other row.

The formula in a value column: =SUMIFS(Lines[Value],Lines[From],[@From])

The EndBlock table works the same as the StartBlocks table. The difference is that we use each column category linked to the main Data table. After every nth row, insert a Gap row.

Formula: =SUMIFS(Lines[Value],Lines[To],[@To])

The final part of the calculations is a named range called “Divider.” We will use this range as a horizontal category axis. It establishes the starting and ending points of the chart’s gradient.

#4. Insert Stacked Area Charts as Flow Lines

The connector lines in a diagram are created using 100% stacked area charts, where each ‘slice’ is shaped by the calculations above.

sankey-diagram-setup

The next step is to format the chart. Right-click on the axis and click Format Axis. Under “Axis Options,” check Date Axis. Also, check the “Dates in reverse order” checkbox.

dates-in-reverse-order-axis-format

Finally, clean up the chart area. Delete legends and the chart title. Apply “No fill” for the chart background.

Repeat this process for each connector row. The overall chart is constructed by stacking these mini-charts in a precisely aligned layout. Why area charts? Because they let us control the top and bottom boundaries of a shape. When stacked and filled with opacity, they mimic the soft curves of connectors.

#5. Create Start and End Blocks

The source and destination blocks are 100% stacked column charts. Each segment represents a category (John, Peter, Apple, etc.) with gaps between them for separation.

  • StartBlock Table: Sums values for each “From” name using: =SUMIFS(Lines[Value], Lines[From], [@From])
  • EndBlock Table: Mirrors this logic using the “To” column: =SUMIFS(Lines[Value], Lines[To], [@To])
create sankey diagram in excel - format-blocks.png

Formatting:

  • Set plot order to reverse (so top-to-bottom layout matches expectations)
  • Fill each block with a category-specific color
  • Apply “No Fill” to the Gap rows to ensure spacing
  • Add data labels for clarity

Align the charts precisely so the flows visually connect to the correct blocks. Excel doesn’t support mixed-type series within one chart, so we use multiple overlaid charts to simulate a single cohesive visual.

#6. Customization

Once all elements are in place:

  • Adjust transparency, colors, and widths for maximum legibility
  • Use Excel’s alignment and grouping tools to keep the diagram organized
  • Consider hiding axes, resizing chart areas, or removing borders for a cleaner layout
how-to-create-excel-sankey-diagram-standard-charts

Save the finished workbook as a template to make future diagrams easier. You can swap in a new dataset, adjust the tables, and reuse the entire charting structure. Manual Sankey diagrams require effort, but they’re flexible, portable, and fully customizable.

Creating a complex diagram manually in Excel isn’t just a workaround. By transforming source-to-target data into stacked area and column charts, and controlling each connector’s shape and flow with calculated spacing, you get complete creative control over the outcome. This approach encourages precision, creativity, and problem-solving that pays off in both visuals and versatility. And once you’ve done it by hand, every chart you build afterward will feel just a little more intentional.

Advantages and Limitations

This approach works entirely within Excel and provides considerable control over the visual appearance. However, it requires manual chart configuration and precise alignment.

It is best suited to relatively small, stable two-stage datasets. Adding new categories or extending the diagram across multiple stages requires additional effort. You can download the template here.

Method 2: Create a Sankey Diagram Using Advanced Excel Formulas

Modern Excel functions let you build more sophisticated Sankey diagrams by calculating their geometry directly from the underlying data. Instead of assembling numerous independent area charts, this approach generates coordinate arrays that describe the positions of nodes, connections, and labels.

How It Works

The implementation consists of several interconnected calculation layers:

  1. A structured Excel table containing the original multi-level data.
  2. Configuration parameters defining spacing, scaling, and layout.
  3. Dynamic arrays calculating horizontal and vertical coordinates.
  4. Cumulative calculations determining flow positions.
  5. Label coordinates and node descriptions.
  6. Scatter chart series rendering the calculated geometry.
Create a Sankey Diagram in Excel Using Advanced Excel Formulas

Functions such as LET, LAMBDA, SCAN, REDUCE and TOCOL allow complex calculations to be organized into reusable formulas.

Once the calculation model has been established, changes to the input data can propagate through the coordinate arrays and update the visualization within the supported workbook structure.

Advantages and Limitations

This method provides extensive control over the underlying visualization logic and supports more sophisticated multi-stage structures. It is particularly useful for advanced Excel users who want to understand how quantitative data can be transformed into visual geometry without relying on an external rendering engine.

However, the initial implementation is technically demanding, requires compatible modern Excel functions, and can become difficult to maintain as layout requirements grow. For the complete formula-based implementation, see this dedicated tutorial.

Method 3: Create a Sankey Diagram Using an Excel Add-in

A dedicated Excel add-in automates the layout and rendering calculations required to create a Sankey diagram. Rather than calculating coordinates or manually assembling charts, users can focus on preparing their data and selecting appropriate visualization settings.

Steps to create a Sankey Diagram in Excel:

Using SankeyEngine as an example:

  1. Install the Excel add-in.
  2. Organize your data into a supported tabular format.
  3. Select the relevant worksheet data.
  4. Open the Sankey diagram tool.
  5. Generate the diagram and customize its appearance.
Create a Sankey Diagram Using an Excel Add-in

The rendering engine calculates node positions, proportional flow widths, connection geometry, and layout automatically. Depending on the software, users may also be able to select nodes, highlight connected flows, and examine upstream and downstream relationships interactively.

Advantages and Limitations

Excel add-ins are particularly useful for recurring reports, spreadsheet-based workflows, and users who want to create Sankey diagrams without developing their own visualization model. Their capabilities depend on the specific add-in, supported data structures, installation requirements, and available analytical features.

For a practical implementation, explore the SankeyEngine Free Edition.

Method 4: Create a Sankey Diagram Using Standalone Analytics Software

Excel does not necessarily need to be the environment in which the Sankey diagram is rendered. It can also serve as the data source for a dedicated visualization or analytics application.

This approach separates data preparation from visualization and analytical exploration.

From Excel Data to Interactive Visualization

Using ZeniGraph as an example, the workflow consists of four main steps:

  1. Prepare a structured multi-level Excel dataset.
  2. Load the dataset into the analytics application.
  3. Select the Sankey visualization mode.
  4. Explore the resulting flow structure interactively.

The same underlying data can also be examined through alternative analytical perspectives, depending on the capabilities of the application.

In ZeniGraph, these include Flow Network visualization, node-level analysis, upstream and downstream relationships, observed paths, flow patterns, and quantitative comparisons.

Beyond the Sankey Diagram

Consider a recruitment dataset containing acquisition channels, application types, interview stages, and final hiring outcomes. A conventional Sankey diagram reveals how applicant volume is distributed throughout the process.

However, additional analytical questions may arise:

  • Which acquisition channels have the highest hiring rates?
  • Where do candidates from a selected channel ultimately end up?
  • Which complete recruitment paths were actually observed?
  • How do outcome distributions differ between selected groups?

Answering these questions requires more than generating the initial visualization. It requires access to the underlying analytical relationships and, where relevant, complete observed paths.

Advantages and Limitations

Standalone analytics software is particularly useful when the objective extends beyond creating a diagram for a report or presentation. It provides a dedicated environment for investigating complex datasets without requiring users to construct or maintain visualization formulas inside Excel. However, it introduces a separate application into the workflow and may require additional installation or licensing. Learn more about this approach in our Universal Flow Analytics guide.

Comparing the Four Excel Sankey Diagram Methods

FeatureStandard ChartsAdvanced FormulasExcel Add-inStandalone Software
Advanced Excel formulasNoYesNoNo
Additional softwareNoNoYesYes
Initial setupManualComplexGenerally simpleGenerally simple
Automatic layoutLimitedFormula-drivenYesYes
Multi-stage visualizationDifficultPossibleTool-dependentTool-dependent
Interactive explorationLimitedLimitedTool-dependentTool-dependent
Advanced flow analyticsCustom implementationCustom implementationTool-dependentTool-dependent
Works within ExcelYesYesYesNo

The comparison reflects the general characteristics of each approach. Specific capabilities vary between implementations and software products.

Which Method Should You Choose?

The best method depends on what you want to achieve.

  • Choose standard Excel charts if you need a relatively simple, two-stage visualization without installing additional software.
  • Choose advanced Excel formulas if you want to build a reusable visualization model and understand the mathematical principles behind Sankey diagram construction.
  • Choose an Excel add-in if you regularly work with spreadsheets and want to automate diagram creation within your existing Excel workflow.
  • Choose standalone analytics software if you need to investigate complex multi-stage datasets, explore observed journeys, or compare quantitative flow patterns.

Creating a diagram and investigating the data behind it are related but distinct objectives. Understanding this distinction helps you choose an appropriate tool without adding unnecessary technical complexity.

Frequently Asked Questions

Does Excel have a built-in Sankey chart?

Excel does not include a dedicated native Sankey chart type. However, Sankey diagrams can be constructed using standard charts and formulas or generated with specialized software.

Can I create a Sankey diagram in Excel without add-ins?

Yes. Two approaches are to combine stacked area and column charts or to calculate flow coordinates using advanced Excel formulas and scatter charts.

Can I create a Sankey diagram without LAMBDA or VBA?

Yes. The standard chart approach uses traditional Excel formulas, helper tables, stacked area charts, and stacked column charts.

Can I create a multi-level Sankey diagram from Excel data?

Yes. Multi-level Sankey diagrams can be generated from structured Excel datasets using formula-based models, compatible add-ins, or standalone visualization software.

Can I analyze Excel data without uploading it to a cloud service?

Yes. Locally processed Excel add-ins and desktop analytics applications can generate and analyze Sankey diagrams without requiring analytical datasets to be uploaded to a vendor-hosted service.

For more information about data requirements, flow values, visualization choices, and analytical limitations, explore our Sankey Diagram FAQ.

Conclusion

Excel can serve as a data source, a visualization environment, or even the calculation engine behind a Sankey diagram.

All four methods described in this guide offer valid approaches to working with flow-based data. The differences lie primarily in implementation complexity, automation, flexibility, and analytical capabilities.

The objective is not simply to create a Sankey diagram in Excel, but to choose a workflow that allows you to communicate and understand your data effectively.