Deepnote research: our notes on building agents
Get started
← Back to all posts

How to make a bar graph in Excel

By Srihari Thyagarajan•

Updated on October 5, 2026

Follow the steps to create and customize a bar graph in Excel, then use your spreadsheet to build a chart with Deepnote Agent.

When Excel launched for the Macintosh on September 30, 1985, it brought spreadsheet calculations and business graphics together in one application. That combination helped make spreadsheets useful for both working with numbers and presenting them. Creating a bar graph still follows that familiar pattern: arrange the data, choose a chart, and adjust how it displays the results.

Today, data teams can build charts through a notebook workflow instead. Deepnote extends that workflow in a collaborative notebook, where teams can work with the data, calculations, and visualization in one place. With Deepnote Agent, describe the comparison you want, then ask it to prepare the data, build the chart, and refine the result through follow-up prompts.

We'll first build single-series, clustered, stacked, and percentage bar charts in Excel using the same sales table. Then we'll create a sorted stacked chart in Deepnote from a plain-language request.

Bar vs. column charts in Excel

Excel uses Bar for horizontal bars and Column for vertical ones. If you want category names down the left and bars extending to the right, choose Bar. For upright bars, choose Column.

We use horizontal bars here because the region names remain easy to read. They also leave room for longer labels when you apply the same method to products or departments.

Excel's Histogram option answers a different question. It groups individual numerical observations into ranges, such as orders worth $0 to $50 or $50 to $100. It would help us inspect the distribution of order values, while a bar graph compares named categories such as regions.

If the question is how revenue changes month by month, follow the trend with a line graph. Keep the months in calendar order.

Make a bar graph in Excel in four steps

We'll use fictional April 2026 revenue for a retailer selling online and through partners. Every sale belongs to one region and one channel, so Online and Partner can be added without counting the same sale twice. All amounts are in US dollars.

Region

Online

Partner

North

150000

90000

South

160000

60000

East

90000

70000

West

60000

140000

The instructions cover Excel for the web, with desktop menu paths where they differ.

1. Arrange the source data

Paste the table into Excel with one region per row and a heading for each column. Keep the revenue entries numeric, then apply Currency formatting if you want dollar signs in the worksheet.

For a reusable report, select the range and choose Insert > Table, confirming that the table has headers. This gives us named columns for the calculations later in the tutorial.

2. Select the categories and values

Select Region and Online, including their headings and all four data rows. Leave Partner out for now. Our first question is simply which region has the most online revenue.

If your worksheet includes a grand total, exclude it from the chart selection. It summarizes the regions; it is not another region.

3. Insert a 2-D bar chart

In Excel for the web, open Insert, find the bar-chart options, and choose Clustered Bar. In desktop Excel, use Insert > Insert Column or Bar Chart > 2-D Bar > Clustered Bar.

Excel uses the Clustered Bar option even when there is only one series. With our selection, that produces one bar per region.

Excel-insert-bar.webp

4. Add a useful title and labels

Name the chart Online revenue by region, April 2026. Label the value axis Revenue (USD) and keep its baseline at zero.

In Excel for the web, select the series and open Format > Series > Data Labels in the chart task pane. On desktop, choose Chart Design > Add Chart Element > Data Labels, then select a position such as Outside End.

Keep dollar labels readable and use one color for the series. A legend saying only “Online” adds little when the title already identifies the measure.

Excel-single-series.webp

South leads online revenue, with North close behind. That is a channel-specific result. We haven't yet checked whether the same region leads total revenue.

Make a clustered bar chart to compare groups

A clustered bar chart places related bars beside each category. Here, each region gets an Online bar and a Partner bar, so we can compare the channels directly.

Select all three original columns, including their headings, and insert another Clustered Bar chart. Keep this version beside the first while you compare the results.

To expand an existing chart instead, use Select Data. In the web chart task pane, update Data > Source to include Region, Online, and Partner. In desktop Excel, open Chart Design > Select Data and expand the chart data range.

  • Use a consistent color for each channel. Online should keep the same color in every region and in the stacked versions below.
  • Keep both series on the same value axis. They are both revenue in dollars. A second axis would make their lengths harder to compare fairly.

Excel-clustered.webp

West is the only region where Partner revenue exceeds Online revenue. The first chart made West look small because it showed only online sales; the grouped view exposes the channel that contributes most there.

If Excel groups the wrong things

The category labels should be North, South, East, and West. The legend should identify Online and Partner.

If Excel gives you two channel categories with four region-colored series, change how the data fields are split. In the web task pane, use Data > Source > Data Fields split by and choose columns for the series. On desktop, select Chart Design > Switch Row/Column.

Changing the grouping is separate from changing the chart orientation. Choose Bar or Column to make the marks horizontal or vertical.

Start with a PivotTable when you have transaction rows

Our example is already summarized. If your export has one row per sale, with fields such as Region, Channel, Date, and Revenue, summarize it before charting.

Choose Insert > PivotTable, then arrange the fields like this:

  • Rows: Region.
  • Columns: Channel.
  • Values: Revenue, summarized by Sum.

PivotTable.webp

Add Date to the PivotTable’s Filters area and select only dates in April 2026, enabling multiple selection if the export contains individual dates. Check that other months are excluded and that the value field says Sum of Revenue. Count of Revenue counts populated records instead of adding their dollar amounts.

In Excel for the web, select a cell in the PivotTable and insert a clustered bar chart. On Windows desktop, you can use Insert > PivotChart. When new transactions arrive, refresh the PivotTable and check that its source includes the new rows. Keep grand totals out of the plotted categories.

Make stacked and 100% stacked bar charts in Excel

Clustered bars compare the channels separately. Stacked bars combine them into one bar per region. A 100% stacked version makes all those bars the same length so we can compare their proportions.

Stacked bars: compare totals and their components

Select Region, Online, and Partner, then choose Stacked Bar from the bar-chart options under Insert. On desktop, the full path is Insert > Insert Column or Bar Chart > 2-D Bar > Stacked Bar.

You can also change an existing clustered chart's type. On desktop, use Chart Design > Change Chart Type > Bar > Stacked Bar.

Keep Online first and Partner second throughout the chart. If you add a Total revenue column for calculations, do not include it as another series: Online plus Partner already forms the whole bar.

Excel-stacked.webp

North now has the largest total, although South led online revenue. North's additional partner revenue changes the ranking. This is where stacking helps: we can read the regional total and see what contributes to it.

Stacking becomes less helpful when we need to compare a segment in the middle of several others. Those segments start at different positions. We would return to clustered bars for that comparison.

100% stacked bars: compare the channel mix

Using the same selection, choose 100% Stacked Bar in Excel's bar-chart gallery. On desktop, use Insert > Insert Column or Bar Chart > 2-D Bar > 100% Stacked Bar.

Excel scales each region's combined Online and Partner revenue to 100%. The original dollar amounts are enough to create the chart. In the example below, we use calculated shares so the segment labels also display percentages; the next subsection covers those formulas.

Partner sales account for 70% of West's revenue. South relies much more heavily on online sales. Equal bar lengths make the mix easier to compare, but they hide the fact that the regions bring in different amounts of money. Keep the ordinary stacked chart nearby when both size and mix matter.

Add percentage labels that match the chart

A percentage axis does not guarantee percentage data labels. If labels still show dollars, we need to calculate the shares or use labels linked to those calculations.

In the Excel table we created earlier, add two columns named Online share and Partner share. Enter these formulas in their first data rows:

=[@Online]/([@Online]+[@Partner])
=[@Partner]/([@Online]+[@Partner])

The @ reference means “from this row.” Format both columns as percentages. For West, the results should be 30% and 70%.

We have two useful ways to apply them:

  • Plot the calculated shares. Prepare a three-column chart range containing Region, Online share, and Partner share. Build the 100% stacked chart from it, then add value labels formatted as percentages. Keep the original revenue columns for the dollar comparison.
  • Keep the dollar-based chart on desktop. For each series, open Format Data Labels > Values From Cells, select the matching percentage cells, and clear Value so the labels don't also display dollars.
Excel-percent-stacked.webp

If a region's total is zero, its channel shares are undefined. Leave that region out of the percentage comparison and explain why; showing two zero shares would imply a valid mix where there is no revenue to divide.

Sort and reorder bars in Excel

Sorting should follow the comparison. Online revenue, total revenue, and partner share produce different rankings in this example.

Sorting the source table also reorders charts linked to it. If you want the online-revenue chart and total-revenue chart to keep different rankings, give each its own sorted input range. The SORTBY approach below lets us do that while keeping the source rows in place.

Sort the whole table by the measure that matters

For the single-series chart, use the Online column's table-header menu to sort from largest to smallest. For a stacked chart, add Total revenue with this formula:

=[@Online]+[@Partner]

Sort by that new column, again from largest to smallest. Keep Total revenue out of the chart series. The expected ranking is North, South, West, East.

An Excel table keeps each row's region and amounts together. If you're sorting a regular range and Excel asks whether to expand the selection, expand it to include all related columns. Sorting only the revenue cells can attach the right numbers to the wrong regions (an easy mistake to miss in a polished chart).

Put the largest bar at the top

Horizontal bar charts can display the first worksheet row at the bottom. Sorting the table correctly does not always give the top-to-bottom order you expect.

On desktop, select the vertical category axis, open Format Axis > Axis Options, and enable Categories in reverse order. If this moves the value axis to the top, set Horizontal axis crosses to At maximum category in the category-axis settings.

In Excel for the web, select the vertical axis and use its reverse-order control in the formatting pane. Check the category names after applying it; we are reversing the region order, not the numerical revenue scale.

Excel-reverse-category-order.webp

The ranked view makes North's lead easy to find and keeps each region's channel mix intact. If you instead want to rank dependence on partners, sort by Partner share and name that comparison in the title.

Keep the source order and create a sorted view

For a recurring report, we may want the source table to stay in its original order. In Excel versions with SORTBY, name the table Sales and enter this formula in a blank area outside the table:

=SORTBY(Sales[[Region]:[Partner]],Sales[Online],-1)

This returns Region, Online, and Partner sorted by Online revenue, largest first. Add those headings above the result. Leave the cells beneath and beside the formula empty so Excel has room to display the returned rows.

To rank by the calculated total instead, use:

=SORTBY(Sales[[Region]:[Partner]],Sales[Total revenue],-1)

Build the chart from that sorted result. The formula reorders it as values change, without moving the source rows. If you add new regions, check that the chart's selected range includes the expanded result too. A dynamically expanding formula and a dynamically expanding chart range are separate things.

Excel-sorted-stacked.webp

Or, create a bar graph much faster with Deepnote Agent

You can start with our bar graph maker or work directly in a Deepnote project. Here, we’ll upload the Excel workbook used above and ask Deepnote Agent to build the report from its source table.

Upload the workbook to the project, then open Deepnote Agent. There’s no need to copy the revenue figures into the conversation.

Ask Agent:

Use the uploaded Excel workbook to create a horizontal stacked bar chart of April 2026 revenue by region. Find the source table containing Region, Online, and Partner, and use it once. Other worksheets may contain copies or calculated views of the same data.

Calculate total revenue for each region and sort the bars from largest to smallest, with the largest at the top. Use Online and Partner as the two segments, colored purple and teal. Start the value axis at zero, label it “Revenue (USD),” and add dollar labels to the segments. Title the chart “Regions ranked by total revenue, April 2026.”

Show a check table with each region’s Online revenue, Partner revenue, and total, plus the overall revenue total. Briefly explain which region leads total revenue and which relies most on Partner sales.

bar-graph-deepnote-agent.webp

bar-graph-deepnote-agent-response.webp

The interactive chart below uses the same data as the Excel examples. North leads with $240,000 in total revenue, while West’s larger Partner segment shows why its total exceeds East’s despite lower Online sales.

To compare the channel mix, ask: “Show each channel as a percentage of regional revenue, keeping the same region order and colors.” Agent can update the calculations and chart without requiring us to configure a second chart through menus.

For a transaction export, Agent can also filter the dates and sum revenue by region and channel before plotting. The code and results remain in the notebook, where we can review the calculations, request changes, and share the finished chart.

For a quick starting point, use the bar graph maker. If you’re still deciding which chart fits the question, describe your comparison in the AI chart generator.

Frequently asked questions

01

How do you make a bar graph in Excel with two sets of data?


02

What is the difference between clustered and stacked bar charts?


03

How do you make a stacked bar chart in Excel with percentages?


04

How do you sort a bar chart in Excel from largest to smallest?


05

How do you add data labels to a bar graph in Excel?


Srihari Thyagarajan

Technical Writer

Follow Srihari on Twitter, LinkedIn and GitHub

Blog

Illustrative image for blog post

How data teams are actually building the context layer

By Jakub Jurovych

•

Updated on September 1, 2026

Try Deepnote now

Get started – it’s free
Book a demo

Footer

Solutions

  • Python notebook
  • SQL notebook
  • R notebook
  • Data apps
  • Machine learning
  • Data teams

Product

Company

Comparisons

Resources

Tools

Footer

  • Privacy
  • Terms

© 2026 Deepnote. All rights reserved.