How to Make a Sankey Diagram in Excel with AI

Cody Schneider8 min read

Creating a Sankey diagram in Excel used to be a complex, multi-step process reserved for spreadsheet wizards. Today, you can use AI to do the heavy lifting, turning a confusing task into a manageable one. This guide will walk you through exactly how to prepare your data with AI and then build a clear, insightful Sankey diagram directly in Excel.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

What Exactly is a Sankey Diagram?

A Sankey diagram is a type of flow chart where the width of the arrows or bands is proportional to the quantity of the flow. Think of it like a map for your data that shows how an amount moves from one stage to another. The thicker the band, the larger the quantity it represents.

They’re perfect for visualizing things like:

  • Website User Flow: See how visitors move from different traffic sources (like Organic Search or Social Media) to various pages on your site (Homepage, Blog, Pricing page).
  • Marketing & Sales Funnels: Track how leads progress from "Awareness" to "Consideration" to "Purchase," and identify where the biggest drop-offs occur.
  • Budget Allocation: Visualize how a department's budget is distributed across different categories, like salaries, software, and advertising.
  • Supply Chain Management: Follow the path of products from manufacturers to distributors to final retail locations.

The beauty of a Sankey diagram is its ability to instantly highlight the most significant paths, movements, or contributions in a system. You can see at a glance where most of your traffic is coming from, which ad campaigns are driving the most revenue, or where a budget is being spent most heavily.

The Challenge: Why Sankeys are Tricky in Excel

Excel doesn’t have a built-in Sankey chart type. To create one manually, you have to perform some serious spreadsheet gymnastics. The traditional method involves:

  • Building a complex data table with many “helper” columns.
  • Calculating precise positions and padding for each flow.
  • Creating a stacked bar chart and carefully formatting it.
  • Making some parts of the chart invisible and coloring others to create the illusion of flowing bands.
  • Painstakingly adding labels and connectors.

It’s time-consuming, tedious, and a single mistake in a formula can throw the entire visual off. This complexity is precisely where AI tools can completely change the game.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

The AI-Powered Workflow: From Raw Data to Sankey Chart

Instead of wrestling with formulas, we can use an AI assistant like ChatGPT (with the Advanced Data Analysis feature) or Microsoft Copilot to structure the data for us. The AI will act as our data prep expert, generating the complicated table Excel needs. Then, we can just feed that data into a simple chart.

Here’s the step-by-step process.

Step 1: Get Your Raw Data Ready

First, you need to organize your data into a simple three-column format: Source, Target, and Value.

Let's use a website traffic example. We want to see how users from different channels land on different parts of our website. Your raw data in a Google Sheet or Excel file would look something like this:

Source,Target,Value Organic Search,Homepage,1500 Paid Social,Landing Page A,1200 Direct,Homepage,800 Organic Search,Blog Post,750 Email Marketing,Landing Page B,600 Paid Social,Homepage,400 Paid Search,Landing Page A,300 Email Marketing,Homepage,250

This simple structure clearly shows the flow. For example, 1,500 users went from "Organic Search" to the "Homepage." Save this file as a CSV (e.g., traffic-flow-data.csv) so you can upload it to an AI tool.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 2: Ask an AI to Structure Your Data

Now, it's time to let AI do the hard work. We'll use ChatGPT's Advanced Data Analysis feature for this example, but the prompt can be adapted for other capable AI assistants.

  1. Navigate to ChatGPT (you’ll need a Plus subscription for the file upload feature).
  2. Click the paperclip icon in the message box to upload your traffic-flow-data.csv file.
  3. Once uploaded, use a prompt like the one below. The key is to be specific about what you need for the Excel chart.

Here's a sample prompt you can adapt:

"I have uploaded a CSV file with three columns: Source, Target, and Value. I want to create a Sankey diagram in Excel using a stacked bar chart method. Can you please process this file and generate a new table structured for this purpose? The output should include columns for calculating the layout of the chart, like nodes, padding, offsets, and the actual flow values. Please provide the final data in a downloadable CSV file."

The AI will analyze your simple table and perform all the calculations needed behind the scenes. It will generate a much more complex table designed specifically for Excel's stacked bar chart. The output it gives you will be structured with several new columns. It's not important to understand every single calculation it made, the goal is simply to have the final, chart-ready data without doing the math yourself.

Step 3: Build the Chart in Excel with the AI-Generated Data

The AI will provide a link to download the new, ready-to-use CSV file. Download it and open it in Excel. Now you have all the necessary components formatted correctly. It's time to build the visual.

1. Create the Stacked Bar Chart

Your AI-generated data is already set up to be plotted.

  • Select all the data that the AI produced. Don't worry if it looks like a lot of columns. Just select the entire table from corner to corner.
  • Go to the Insert tab on Excel’s ribbon.
  • Click on Insert Column or Bar Chart.
  • Select 2-D Bar, and then choose Stacked Bar.

You'll immediately see a colorful stacked bar chart, which doesn't look like a Sankey diagram yet, but you're on the right track!

2. Format the Chart to Create the "Flow" Illusion

This is where the magic happens. We'll make the "filler" or "padding" sections of the bar chart invisible, leaving only the bands that represent the actual data flows.

  • Identify the data series that represent the blank spaces or "padding" in the chart. Your AI-generated data likely named these something obvious like 'Padding' or 'Spacer'.
  • Right-click on one of the 'Padding' bars in your chart and choose Format Data Series.
  • In the pane that appears, go to the Fill & Line section (the paint bucket icon).
  • Under Fill, select No fill.
  • Repeat this for any other series that acts as a spacer. Just right-click the segments in the chart, format the series, and set the fill to "No fill."

As you make these sections transparent, you'll start to see the colored bars 'floating' - these are your flows!

3. Reverse the Vertical Axis

Often, Excel will plot your data upside down from how you’d typically read a Sankey. It's an easy fix.

  • Click on the vertical axis (the labels on the left side) of your chart to select it.
  • Right-click and select Format Axis.
  • In the Format Axis pane, under Axis Options, check the box for Categories in reverse order.

This flips the chart, making it much more intuitive to read.

4. Clean Up and Final Touches

The last step is to remove unnecessary chart elements to give it a clean, professional look.

  • Add a Title: Click on the chart title to edit it (e.g., "Website Traffic Flow - Last 30 Days").
  • Remove the Legend: Click on the legend (the colored boxes with labels) and press 'Delete'. Your flows are visual enough.
  • Remove Axes and Gridlines: Click on the horizontal axis at the top and press 'Delete'. Then, do the same for the gridlines in the background. Your chart layout should ideally already have the node labels, so the vertical axis isn't needed either.
  • Adjust Colors: You can right-click any of the visible bars (your flows) and select Format Data Series to change their colors to better match your branding or categories.

You now have a polished, professional-looking Sankey diagram in Excel that effectively visualizes your data flow - all without writing a single complex formula.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Final Thoughts

By using AI to handle the difficult data preparation, you can transform the process of creating a Sankey diagram in Excel from a daunting technical exercise into a straightforward visualization task. This workflow bridges the gap between your raw data and a powerful visual story, helping you uncover insights faster.

While this method makes building charts in Excel much easier, we know that exporting data, using AI prompts, and formatting charts is still a multi-step routine. To eliminate this friction entirely, we built Graphed . It allows you to connect your data sources directly (like Google Analytics or Shopify) and just ask for the visualization you need in plain English - no CSV uploads or manual chart formatting required. It builds live dashboards that stay up-to-date automatically, letting you spend your time on insights, not setups.

Related Articles