To add a legend to a stacked bar chart in Excel for Microsoft 365 on Windows, select the chart, then choose Chart Design > Add Chart Element > Legend and select a position such as Right or Bottom. A legend identifies the data series represented by the differently colored sections of each bar; if the chart has only one series, a legend may add little useful information.
What the legend shows in a stacked bar chart
A stacked bar chart uses one horizontal bar for each category, with colored segments stacked end to end to show the values of multiple data series. The legend maps each color to a series name. For example, a chart comparing monthly sales of three products might use one bar per month, with separate segments for Product A, Product B, and Product C. The legend tells readers which segment belongs to each product.
Excel draws the legend from the chart’s series names and assigns the series colors to the corresponding legend entries. It does not normally list each bar category in the legend. In the sales example, months such as January and February appear along the category axis, while the product names appear in the legend. This distinction is important when a chart seems to have the wrong labels: the legend explains the stacked components, not the bars themselves.
A stacked bar chart is horizontal. A stacked column chart uses the same stacking idea but displays vertical columns. The legend controls are essentially the same for both chart types, so the steps below also apply to stacked columns.
Add a legend using the ribbon
In Excel for Microsoft 365 on Windows, use the chart’s ribbon commands to display a legend:
- Click the stacked bar chart. The contextual Chart Design and Format tabs should appear.
- Open Chart Design > Add Chart Element > Legend.
- Choose a location: Right, Top, Left, Bottom, or More Legend Options, if available.
The legend should appear inside or beside the chart, depending on the selected position and the chart’s layout. If you choose More Legend Options, Excel opens formatting controls for additional settings. You can also select the chart and use the green Chart Elements button, shown as a plus sign beside the chart, then check Legend. Use its arrow to pick a position. If the plus button is not visible, use the ribbon method.
To remove the legend, open the same Chart Design > Add Chart Element > Legend menu and choose None. Alternatively, select the legend itself and press Delete. Deleting the legend does not remove the data series or the colored segments; it only hides the explanatory key.
Arrange the source data so the legend is meaningful
Excel usually builds the legend from the column or row headers included in the chart’s source range. A simple layout for monthly product sales could look like this:
- Column A contains month names, such as January and February.
- Columns B, C, and D contain the sales values for Products A, B, and C.
- The top row contains the series names Product A, Product B, and Product C.
When you select that table and insert a stacked bar chart, Excel uses the month names for the category axis and the product headings for the legend. Include the header row and category labels in the selected range. If you create a chart first and later extend the table, check that the chart’s data range includes the new rows or columns. A legend cannot display a series that is not part of the chart.
If the chart treats months as series and products as categories, the data orientation may be reversed. Select the chart and choose Chart Design > Switch Row/Column to exchange which rows or columns Excel plots as series. Check the result rather than relying on a fixed rule: the appropriate orientation depends on how the source data is arranged and what you want each bar to represent.
Move the legend and make room for the bars
Legend position affects how much space remains for the plotted data. A legend on the right is convenient when there are several series with short names, but it can squeeze the bars horizontally. A legend at the bottom preserves more horizontal plotting space, though long names may wrap or occupy multiple rows. A top legend can work well for a small number of short labels.
To choose a position, use Chart Design > Add Chart Element > Legend and select the location. You can also click the legend and, when Excel shows the selection handles, drag it to another place. Dragging gives more freedom but can leave the legend overlapping the plot area. If that happens, choose a standard position from the ribbon or resize the chart to give the legend more room.
When a chart is crowded, consider whether the legend needs to be beside the plot at all. Moving it below the chart, widening the chart, or shortening clear series names may improve readability. Avoid shrinking the chart’s text so much that readers cannot distinguish the entries. If the series names are numerous or lengthy, a separate key or a different chart layout may be easier to read than a narrow legend.
Change legend names, order, and appearance
If the legend displays generic labels such as Series1 and Series2, Excel may not have found usable headings in the source data. The best fix is usually to add descriptive headers to the worksheet and make sure the chart’s data range includes them. You can also edit a series name through the chart’s data selection settings:
- Select the chart and choose Chart Design > Select Data.
- In the Select Data Source dialog, select the series to change and choose Edit.
- Enter a series name or select the cell containing the desired heading, then confirm the dialog.
Changing a series name in the chart changes its displayed legend label; it does not rename the worksheet column heading unless you edit that cell separately. When possible, using the cell reference keeps the chart label aligned with the table if the heading changes later.
The legend entries generally follow the chart’s series order. To change that order, select the chart, open Chart Design > Select Data, then use the move-up and move-down controls in the series list. This can change the sequence shown in the legend and the order in which series are stacked. Check the chart after reordering because the visual stacking order matters to interpretation. To format the legend, right-click it and choose Format Legend, or select it and use the formatting pane. Available controls can include text, fill, line, and placement options. Keep the color mapping consistent and use readable text so the key remains easy to scan.
Fix common legend problems
- The legend is missing: Select the chart and turn it on through Chart Design > Add Chart Element > Legend. Confirm that the chart contains more than one useful series and that the chart itself, not a worksheet cell, is selected.
- The entries say Series1 or Series2: Add headings to the source data or edit the series names in Select Data. Include the header cells in the chart’s data range.
- The legend lists the wrong items: Check whether Excel has interpreted rows and columns the wrong way. Try Switch Row/Column, then verify that the category axis and series names now match your intended message.
- A series is absent: Open Select Data and inspect the listed series and chart data range. The missing data may be outside the selected range, or a row or column may have been excluded.
- The legend covers the chart: Choose a standard position such as Bottom or Right, enlarge the chart, or shorten the series labels. A manually dragged legend can overlap the plot area.
- The colors are hard to distinguish: Change a series color using the chart’s formatting controls, then check that the legend swatch and its stacked segments remain easy to tell apart. Do not rely on color alone if the chart will be printed in grayscale.
A common misconception is that adding a legend will add numbers to the segments. It will not. A legend names the series; data labels display values or other labels on the chart. If readers need to know the exact value of each segment, select the chart and use Chart Design > Add Chart Element > Data Labels, then choose a placement that does not make the stacked bars cluttered.
Legend versus data labels and axis labels
These chart elements answer different questions. The legend answers, “Which series does this color represent?” Category-axis labels answer, “Which category does this bar represent?” Data labels answer, “What value is shown by this segment or bar?” A chart can include all three, but using every label option is not always helpful. For a chart with many categories, data labels on every segment can become crowded; for a chart with clear series names, the legend may be all that is needed to explain the colors.
For example, a chart of quarterly expenses might use one bar per quarter and stacked series for Rent, Payroll, and Supplies. The quarter names belong on the category axis, the expense names belong in the legend, and optional data labels can show dollar amounts. If the chart shows percentages instead of totals, a 100% stacked bar chart may be appropriate; that chart emphasizes each category’s proportion rather than its absolute total. The legend still identifies the component series.
Excel for Mac and Excel for the web
In current Excel for Mac, select the chart and look for the chart design controls, then use the legend element or chart formatting options to show and position the key. Ribbon wording and the arrangement of controls can differ slightly by Excel version and window size, but the underlying task is the same: select the chart, enable its legend, and choose a position. The Mac keyboard shortcut for Delete is often Backspace or Delete depending on the keyboard; use the menu if the key behavior is unclear.
Excel for the web also supports chart editing, though some advanced formatting options and dialog layouts can differ from the Windows desktop app. Select the chart and use the available chart controls to add or reposition the legend. If you cannot find a detailed series-editing option in the web interface, open the workbook in the desktop app and use Chart Design > Select Data. Avoid assuming that every desktop formatting-pane option is available in every browser or Excel build.
Frequently Asked Questions
How do I add a legend to a stacked bar chart in Excel?
Select the chart, then choose Chart Design > Add Chart Element > Legend and select a position. The green Chart Elements plus button beside a selected chart is another way to turn the legend on.
Why does my Excel stacked bar chart show Series1 and Series2?
Excel is using default names because it did not identify meaningful series headings. Add column or row headers to the source data, include those header cells in the chart range, or edit each series name through Chart Design > Select Data.
How do I change the order of items in the legend?
Select the chart and open Chart Design > Select Data. Select a series in the list and use the move controls to change its order. Because this can also alter the stacking order, check that the bars still communicate the data as intended.
Can I put the legend inside the chart?
You can select and drag the legend within the chart area in many desktop versions of Excel. Watch for overlap with bars, labels, or the plot area; choosing a built-in position is usually easier to keep tidy.
How do I show values as well as the legend?
Add data labels separately using Chart Design > Add Chart Element > Data Labels. The legend identifies series, while data labels show values. Use labels selectively if the stacked chart has many segments.
Can a one-series stacked bar chart have a useful legend?
Excel can display a legend for a single series, but it usually repeats information that the chart already makes clear. If there is only one meaningful series, removing the legend often gives the bars more space without losing important context.
Related
- Excel Reverse Worksheet Order: How to Do It
- Excel Repair Software Free Full Version: What Works?
- Excel Repair Tools for XLS and XLSX Files: What Works
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Gantt Chart Excel Formula Between Dates: Setup GuideTo show a Gantt bar for dates between a task’s start and finish in Excel, use conditional formatting…
- Excel Pivot Table: How to Keep Formatting on RefreshTo keep formatting when an Excel PivotTable refreshes, select the PivotTable, open PivotTable Analyze > Options, and on…
- Pivot Table Average Not Working? Fix the Source DataIf a PivotTable average is missing, showing Count, or giving an unexpected result, check the value field’s summary…
- Excel Chart Elements: What They Are and How to Use ThemExcel chart elements are the visual parts that explain, organize, or add detail to a chart, such as…
- Balloon Chart in Excel: A Step-by-Step TutorialTo make a balloon chart in Excel for Microsoft 365 on Windows, arrange your data in columns for…
- Percentage Half Moon Chart in Excel: How to Create OneTo create a percentage half moon in Excel, build a doughnut chart from three values: the completed percentage,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.