What a stacked bar graph shows and when to use it
A stacked bar graph displays multiple data series as segments within a single bar, so you can see both the total and how each part contributes to it. Each bar represents one category, and the segments inside it show the breakdown. For example, you might stack monthly sales by product type, or show budget allocation by department across multiple years.
Stacked bars work best when you want to compare totals across categories while also showing the composition of each total. If you need to compare individual segments across categories — like which product sold best in each month — a grouped bar chart works better instead, because stacked segments don't all start at the same point on the axis.
Key Takeaways
- Arrange your data with categories in one column and each data series in its own column, with headers in the first row.
- Select all your data including headers, then use the Insert Chart menu and choose the stacked bar option from the Bar chart type.
- Excel stacks bars in the order your columns appear, so rearrange columns before inserting the chart if you need a different order.
- Add a chart title and legend after creation, and adjust the axis labels if Excel doesn't automatically format them the way you need.
Preparing your data in the right layout
Your data needs to be arranged in a specific way for Excel to recognize it as a stacked bar chart. Put your category labels in the first column — these become the labels along the vertical axis. Put each data series in its own column to the right, with a header in the first row that describes what that column represents.
For example, if you're showing quarterly revenue by product, your layout would be: Product Name in column A, Q1 Revenue in column B, Q2 Revenue in column C, Q3 Revenue in column D, and Q4 Revenue in column E. Each row below the headers contains one product name and its four quarterly values. Excel reads this structure and knows to stack the quarterly values within each product's bar.
Make sure there are no blank rows or columns in the middle of your data range. Excel stops reading when it hits a gap, so if your data has empty cells, select only the continuous block that contains values. Headers are required — without them, Excel treats the first row as data instead of labels.
Selecting your data and inserting the chart
Click on any cell in your data range, then drag to select from the top-left cell (usually your first category label) to the bottom-right cell of your data. You must include the header row. If your data is not rectangular — for example, if some rows have more entries than others — select only the complete rectangle that contains all your data.
With your data selected, go to the Insert tab on the ribbon. Click Chart (or Insert Chart depending on your Excel version). A dialog box opens showing chart type options. Click Bar on the left side to see bar chart variations. Look for the Stacked Bar option — it shows bars with colored segments stacked horizontally. Click it, then click OK.
Excel inserts a chart into your worksheet. The chart uses your data immediately, but the order of the stacks follows the order of your columns. If you need to change which data series appears first, second, or last in each bar, you'll need to rearrange your columns before inserting the chart, or edit the chart's data range afterward.
Changing the order of stacked segments
By default, Excel stacks your data series in the order they appear in your columns from left to right. If your first data column is Q1 and your last is Q4, Q1 will be at the bottom of each bar and Q4 at the top. If you want a different order, you have two options: rearrange your columns before creating the chart, or edit the chart after it's created.
To rearrange before creating the chart, cut and paste your columns into the order you want. To change the order after the chart exists, right-click the chart and select Edit Data (or Select Data). A dialog opens showing your data series listed in order. Click a series name and use the up or down arrow buttons to move it higher or lower in the stack. Click OK when you're done.
Adding titles, labels, and a legend
Click the chart once to select it. A Chart Design tab appears on the ribbon. Click Add Chart Element and select Chart Title. Choose where you want the title to appear — usually "Above Chart" — and type your title in the text box that appears. This title should describe what the chart shows, like "Revenue by Product and Quarter."
A legend automatically appears on the right side of the chart, showing which color represents which data series. If you want to move it, click Add Chart Element again, select Legend, and choose a new position. If the legend is covering important parts of your chart, move it to the bottom or right side.
To add axis titles, click Add Chart Element and select Axis Titles. Choose Primary Horizontal to label the bottom axis (usually showing values or totals) and Primary Vertical to label the left axis (usually showing categories). Type descriptive labels like "Total Revenue" and "Product Name."
Adjusting the axis scale and formatting
Excel automatically sets the scale of your horizontal axis based on your data. If the largest value in your data is 500, the axis might go to 600 to leave room. If you want to change this — for example, to make the axis go to 1000 instead — right-click the horizontal axis numbers and select Format Axis. Under Axis Options, change the Maximum value to whatever you prefer.
You can also adjust how many gridlines appear and whether the axis shows decimal places. These options are in the same Format Axis panel. If your category labels (the product names or other categories on the vertical axis) are too long and overlap, right-click them and select Format Axis. Under Text Options, you can rotate the text or reduce the font size.
To change the colors of your stacked segments, right-click any segment in the chart and select Format Data Series. You can change the fill color for that entire series across all bars. To change just one segment in one bar, click once to select the series, then click again on the specific segment you want to modify.
Frequently Asked Questions
Can I make a stacked bar chart with more than three data series?
Yes. Excel can stack as many data series as you have columns. However, if you stack more than four or five series, the smaller segments become hard to see and compare. Consider whether a grouped bar chart or a different visualization might work better for your data.
What's the difference between a stacked bar and a stacked column chart?
A stacked bar chart has bars running horizontally (left to right), while a stacked column chart has bars running vertically (bottom to top). Both stack the same way; the choice is about which orientation makes your data easier to read. Horizontal bars work better when your category names are long.
How do I show the actual values inside each segment?
Right-click any segment in the chart and select Add Data Labels. Excel places the value for that series on each segment. If the labels overlap or look crowded, right-click them and select Format Data Labels to adjust the font size or position.
Can I change which data series appears at the bottom of the stack?
Yes. Right-click the chart, select Select Data, and use the arrow buttons next to the series list to reorder them. The series at the top of the list appears at the bottom of each bar, and the series at the bottom of the list appears at the top of each bar.
What if my data has blank cells?
Excel treats blank cells as zero values. If you have intentional blanks (missing data), the chart will still work, but those segments won't appear. If blanks are accidental, fill them in before creating the chart to avoid misleading totals.