A stacked bar chart in Excel shows how a total breaks down into its parts, with each category's segments stacked end to end so the overall length represents the total. You set it up by arranging your data with one label column and one numeric column per series (rows as categories, columns as segments or the reverse), selecting the range, then choosing Insert > Insert Column or Bar Chart > Stacked Bar. The main thing people get wrong is data layout, not the chart itself, so get the table right first and the rest takes a minute.
What You'll Need
- Excel for Microsoft 365, Excel 2021, 2019, 2016, or Excel for Mac, or Excel for the web. Labels and button names can differ slightly by version, platform and region, so if a menu you read here looks slightly different, look for the closest match.
- A data table with one row or column per category and one series per segment, containing only numbers in the value cells (no text, currency symbols typed as text, or blank cells inside the range).
- Clean data: consistent category names, no merged cells, and no totals column mixed in with the detail columns.
Step-by-Step
- Lay out the data in a grid. The most reliable layout puts category names down the left column and one column per segment to the right. A simple example: a column of months with columns for Hardware, Software and Services beside them. Each row is one stacked bar, and each column becomes one colour in the stack. Every row must have a value in every segment column, or use a genuine zero rather than leaving a gap.
- Leave out totals and subtotals. If you include a Total column, Excel stacks it on top of the segments and every bar roughly doubles in length. Keep totals in a separate summary table, or add them with a chart feature later (Excel does not add automatic totals to stacked bars, so a separate column or an axis reading is the practical route).
- Check the numbers are real numbers. Select the value cells and look at the status bar at the bottom of the window. If it shows a count but no sum, the cells are stored as text. Convert them with Data > Text to Columns > Finish, or by retyping without stray spaces or apostrophes.
- Select the whole block including headers — category labels, column headers and all the numbers. Do not select only the numbers; Excel needs the headers to name the legend and the labels to name the bars.
- Insert the chart. On the ribbon go to Insert, find the Charts group, click Insert Column or Bar Chart, and under 2-D Bar choose Stacked Bar. In older versions the gallery label is similar. Excel for the web has the same Insert menu with a Charts button.
- Confirm which way the data is read. If Excel has swapped rows and columns — categories in the legend instead of on the axis — click the chart, open Chart Design (called Chart Tools > Design in some versions), and click Switch Row/Column. This is the single most common fix.
- Fix the category order. Excel plots horizontal bars bottom-up, so the first row of your data appears at the bottom of the chart. To flip it, right-click the category axis, choose Format Axis, and tick Categories in reverse order. If the value axis then jumps to the top, tick Values in reverse order too.
- Add and format a title and axis titles. Click the chart's title placeholder and type a description such as "Quarterly Revenue by Product Line". Add axis titles through Chart Design > Add Chart Element > Axis Titles if they are not already shown.
- Show values. Right-click any segment and choose Add Data Labels to print the numbers on the bars. If the labels overlap on small segments, right-click a label, open Format Data Labels, and adjust position or font size, or switch to a 100% stacked bar if you care about proportions more than absolute totals.
- Adjust colours and spacing. Click a single segment once (which selects one series, then all bars in that series), then use Format > Shape Fill or the Chart Design > Change Colors gallery to pick a readable palette. Right-click a series and choose Format Data Series to change the gap width between bars in the same dialog's Options section.
- Add a legend and remove clutter. Use Chart Design > Add Chart Element > Legend and place it at the bottom or right. Delete gridlines by clicking one and pressing Delete if the labels already carry the numbers.
- Keep it updating. If you expect to add rows, convert the source range to a table with Ctrl+T (Command+T on Mac) before inserting the chart, then right-click the chart and choose Select Data to point it at the table. The chart will grow as the table does.
Common Mistakes
- Including a totals column, which doubles every bar. Smart stacked bars never contain their own total as a segment.
- Selecting only the number block so the legend reads "Series1, Series2" instead of your column names.
- Leaving blank cells inside a series: Excel treats them as zero in a stacked bar, so a missing month silently disappears rather than showing as unknown.
- Choosing Clustered Bar when a stacked one was wanted, or vice versa; the gallery thumbnails look similar at small sizes.
- Using too many segments. More than about five or six colours per bar makes it hard to match legend colours to slices, and small segments become unreadable.
- Mixing units on one axis, such as currency and headcount in the same stack, which makes the bar meaningless.
- Categories typed with inconsistent spelling or trailing spaces, which split what should be one row into two.
Tips
- Use a 100% stacked bar (same Insert menu, the percentage variant) when you want to compare composition rather than volume; every bar is the same length and shows shares.
- Order the category axis by size for easier reading: sort the source table before charting, since the axis order follows data order.
- Put the largest segment at the base of each stack by reordering the columns in the source table. Readers compare the bottom segments most accurately.
- Keep one colour per segment across every chart in a report so readers learn the palette once.
- Use a diverging pair of colours when one segment represents a loss or negative value, and note that negative numbers in a stacked bar are drawn below the zero line, which can look confusing; a clustered chart may suit mixed-sign data better.
- Copy the finished chart and use Paste Special to paste it as a picture into documents where the recipient may not have the workbook.
Troubleshooting
The bars all look the same length or one segment dominates. A totals column is almost certainly included. Remove it and rebuild the chart, or right-click the chart, choose Select Data, and untick the total series in the left-hand list.
Legend shows Series1, Series2. The headers were not in the selected range. Reselect including the header row and reinsert, or use Select Data and set each series name manually.
Categories appear in the legend. Rows and columns are reversed; click Switch Row/Column on the Chart Design tab.
Numbers show as zero or the bar ignores a row. Those cells are blank or stored as text. Type a 0 in blanks if zero is the true value, and convert text numbers with Text to Columns.
The chart does not update when you add data. The chart still points at the old fixed range. Right-click, choose Select Data, and extend the range, or use a table as described above.
Labels overlap or spill outside the plot area. Reduce label font size, remove some labels, or switch to a 100% stacked bar. If bars are very short, widen the chart by dragging its handles.
The axis runs the wrong way. Right-click the category axis > Format Axis, and use Categories in reverse order. If needed, also tick Values in reverse order so the numbers stay at the bottom.
Frequently Asked Questions
Can a stacked bar chart show totals on top of each bar?
Not automatically. Excel's stacked bar has no built-in total labels. The usual fixes are to add a separate Total series (which would extend the bar, so use a line series on a secondary axis instead), or place a small table beside the chart with the totals.
What is the difference between a stacked bar and a 100% stacked bar?
A stacked bar shows absolute values, so bar lengths differ and the segments represent amounts. A 100% stacked bar turns every bar into the same length and shows each segment as a percentage of that category's total.
Why are my bars in the wrong order?
Excel draws horizontal bar charts from the bottom up, so the first data row lands at the bottom. Use Format Axis > Categories in reverse order, or sort the source table.
Can I stack bars with negative values?
Yes, but Excel draws negatives below the zero line and the segments can overlap visually. For data that mixes gains and losses, a clustered bar chart usually reads more clearly.
Does this work in Excel for the web and on Mac?
Yes. Mac Excel and Excel for the web both offer stacked bar charts from the Insert menu. Ribbon tab names and the exact gallery layout differ slightly between versions and platforms.