To change the key, or legend labels, on a pie chart in Excel, edit the category names in the worksheet cells that supply the chart data; Excel updates the legend to match. To change where the key appears, select the chart and use Chart Design > Add Chart Element > Legend. These steps are for Excel for Microsoft 365 on Windows.
What You’ll Need
- An Excel workbook containing a pie chart, or a small table from which you can create one.
- Access to the cells that provide the chart’s category labels. It is sensible to save a copy first if you are making substantial changes to a shared or important workbook.
- A rough idea of what you mean by key: the text beside each colored slice is the legend, while the names of the slices usually come from the category cells in the source table.
Step-by-Step
- Select the chart and identify its source data. Click the pie chart once so that the chart-specific tabs appear on the ribbon. If you do not know which cells feed it, choose Chart Design > Select Data. In the Select Data Source window, check the range shown for the chart and the entries under Horizontal (Category) Axis Labels. For a typical pie chart, those category labels are the legend entries, and the values beside them determine the slice sizes. The chart usually has just one data series; its series name is not the name of each slice.
- Change the category names in the worksheet. Close the Select Data Source window if necessary, then find the cells containing the current category names. Replace each name with the wording you want, keeping the names aligned with their existing values. For example, if the table lists North, South, and West in A2:A4, changing those cells to Northern region, Southern region, and Western region will usually update the pie chart key immediately. Do not overwrite the values in the neighboring column unless you also intend to change the slice sizes.
- Check that the chart uses the intended label range. If editing the worksheet did not change the legend, select the chart and choose Chart Design > Select Data. Under Horizontal (Category) Axis Labels, select Edit. In the Axis label range box, select the cells containing the intended category names, then choose OK. Choose OK again to close the Select Data Source window. The range should contain the category text in the same order as the corresponding values. Avoid including a blank row or the numeric value cells in the label range.
- Use custom labels when the original names should stay unchanged. If you need to preserve source names for formulas or other reports, make a separate set of display labels in a spare column. For example, keep the original category names in column A and enter reader-friendly alternatives in column C. Then use Chart Design > Select Data, choose Edit under Horizontal (Category) Axis Labels, and select the new label cells. This changes the chart key without renaming the original source data. If the chart contains additional rows later, remember to extend the label and value ranges together.
- Change the key’s position if that is what you meant by change. Select the chart, then choose Chart Design > Add Chart Element > Legend. Pick a position such as Right, Top, Left, or Bottom, or choose None to remove the legend. You can also click the green plus button beside the chart, if it is shown, and use the Legend arrow to choose a position. Moving the legend changes its placement, not the wording of its entries. Excel may resize the chart area to make room for a legend at the side or top.
- Reorder the key by reordering the categories. A pie chart’s legend follows the category order in the source data. To change the order, rearrange the category-and-value rows together in the worksheet, or sort the complete source table by the category or value field you want. Keep every label attached to its correct value; moving just the names can make the chart show the wrong amounts for each category. Check the pie after reordering because the slice sequence changes too. Excel does not provide a separate legend-only order for the individual pie categories.
- Adjust the appearance of an individual key entry or slice. To change a slice’s color, click the pie once to select the series, then click that slice again to select just the data point. Right-click and choose Format Data Point, then use the formatting options in the pane to set its fill. Depending on the chart and Excel build, you can also use Chart Design > Change Colors to apply a coordinated palette to the whole chart. The matching legend marker reflects the slice color; the marker and its category label are not independent objects in a standard pie chart.
- Review the result and save. Confirm that every legend label matches the slice it describes, that no label is cut off, and that the intended category-value pairings remain intact. If the legend is too crowded, widen the chart, move the legend below it, or shorten the display labels. Save the workbook after confirming the chart looks right at the size at which readers will view or print it.
Common Mistakes
Changing the series name instead of the category labels. In Select Data Source, the Legend Entries (Series) area contains the data series name. For a standard pie, that name is not the text beside each slice. To rename the entries in the key, edit the category cells or the Horizontal (Category) Axis Labels range. Changing the series name may affect a chart title or other chart references, but it will not normally rename each pie category.
Editing only the labels or only the values while rearranging data. Each category label must stay beside its own value. If you sort or move one column independently, a slice can be assigned the wrong name. Select the entire source table when sorting, and inspect the chart afterward.
Typing new text directly onto the chart. Clicking a legend label and typing may not work as expected, because the label is linked to the source cells. Change the worksheet text or the category label range instead. This also makes the update easier to maintain when the chart refreshes.
Including headers or blank cells by accident. A header is appropriate only when the chart’s source range is set up to treat it as a header. Selecting an incorrect range can create an unwanted legend entry, omit a category, or make Excel interpret the data unexpectedly. Check both the labels and values selected in the data source dialog.
Expecting the legend to have an independent order or color setting. For a normal pie chart, category order comes from the data, and each legend marker corresponds to its slice. To change the sequence, rearrange the source categories with their values. To change an entry’s color, format the corresponding slice.
Tips
Use short, distinct category names. A legend with labels such as New customers, Returning customers, and Canceled orders is easier to read than one with several long sentences. If the full descriptions must remain available, use concise display labels for the chart and keep the detailed text in the source table or a nearby note.
Keep the chart’s source table simple: one category column and one numeric column is a reliable starting point. Use descriptive headers, avoid empty rows within the data, and include only the categories you want represented. Pie charts are clearest when they show a modest number of meaningful parts; if the key becomes difficult to scan, consider grouping small categories as Other or choosing a bar chart where direct comparisons matter more.
When the source table is an Excel Table, adding a new row may expand the chart’s data automatically, depending on how the chart was created. Verify that the new category appears in both the pie and the key. If you use a fixed cell range instead, update the chart’s source and label ranges when adding categories. For a chart that will be reused, keep any separate display-label column beside the source data and label it clearly so another editor knows its purpose.
On Excel for Mac, the ribbon names are generally similar: select the chart and look for Chart Design, Select Data, and Add Chart Element. Some dialog layouts and controls can differ by release. Excel for the web supports common chart edits, but its available formatting controls can vary; if you cannot find the category range or point-formatting options, open the workbook in the desktop version of Excel.
Troubleshooting
The legend does not update after changing a cell. Confirm that you edited a cell included in the chart’s category label range, not a similarly named cell elsewhere. Select the chart and inspect Chart Design > Select Data > Horizontal (Category) Axis Labels > Edit. Correct the range if needed. If the chart uses a separate display-label column, edit that column rather than the original names.
The legend shows numbers, blanks, or an unexpected label. Open the category label range and check that it points only to the intended text cells. Make sure the range begins and ends on the same rows as the values. Remove unintended blank rows and check whether a header was accidentally included as a category. If the source has a blank category name, type an appropriate label into the source cell.
The wrong slice changes color. Click the pie once, then click the specific slice once more before opening Format Data Point. If the whole pie is selected, Excel may apply the change to all slices. Confirm the category name and value in the worksheet before choosing a color, since visually similar slices can be easy to confuse.
The categories appear in an unexpected order. Check the order of the source rows first. If you used a sort, verify that the full table was sorted and that labels stayed with their values. Also check whether the chart’s source range includes extra rows or a different order of cells than you intended. Rearranging rows in the source table is the dependable way to control the category sequence.
The chart or key is hard to read after moving it. Give the chart more room by dragging a corner, or place the legend at the bottom so it can use the chart’s width. Shorten long labels, enlarge the chart, or reduce the number of categories displayed. If the legend is turned off, restore it through Chart Design > Add Chart Element > Legend and choose a position.
Frequently Asked Questions
What does key mean on an Excel pie chart?
The key is another name for the legend: the list of category labels paired with colored markers. In a standard pie chart, the category labels come from the chart’s source data or its Horizontal (Category) Axis Labels range.
Can I rename a pie-chart legend entry without changing the source cell?
Yes. Create alternative display labels in another worksheet column, then set that range under Chart Design > Select Data > Horizontal (Category) Axis Labels > Edit. The original category cells can remain unchanged.
Can I change only the legend order and leave the pie slices alone?
Not independently for a standard pie chart. The legend follows the category order, and that order also controls the slice sequence. Reorder the category rows together with their values to keep the chart accurate.
How do I change where the pie-chart key appears?
Select the chart and choose Chart Design > Add Chart Element > Legend, then select Right, Top, Left, or Bottom. This changes the legend’s placement, not the labels or slice order.
Why does editing the series name not change the key labels?
The series name identifies the data series as a whole. Individual pie key labels are category names. Edit the source category cells or the category label range to rename those entries.
Can I give each legend item a different color?
Each marker in a standard pie chart takes its color from the corresponding slice. Select the slice as an individual data point and use Format Data Point to change its fill; the legend marker should update to match.
Related
- Excel Solver: Find Numbers That Sum to a Value?
- Excel Solver: Find Combinations That Sum to a Target
- Excel Slicers Explained: Filtering PivotTables and Tables
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Auto Refresh Pivot Charts in Excel: Setup and LimitsIn Excel for Microsoft 365 on Windows, a PivotChart refreshes when its associated PivotTable refreshes; the chart does…
- Excel Pivot Table Grand Total at Top: What WorksYou cannot move a PivotTable’s built-in grand total row to the top in Excel for Microsoft 365 on…
- Excel Bar Graph Too Skinny? Fix Bar Width and SpacingIf an Excel bar graph looks too skinny, select a bar, open Format Data Series, and reduce Gap…
- Excel Waterfall Chart End Value: Set the Final TotalTo make the last bar in an Excel waterfall chart show the ending balance, right-click that bar and…
- How to Make a Chart in Excel Run From Right to LeftTo make an Excel chart read from right to left, select the axis you want to reverse, right-click…
- Excel Pivot Table Using Two Data Tables: How It WorksYes. In Excel for Microsoft 365 on Windows, add both Excel tables to the Data Model, create a…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.