Understand the Legend and Legend Key in Excel Spreadsheets

In a chart or graph in a spreadsheet program such as Microsoft Excel, the legend is often located on the right-hand side of the chart or graph and is sometimes surrounded by a border. The legend is linked to the data being graphically displayed in the plot area of the chart. Each specific entry in the legend includes a legend key for referencing the data.

The information in this article applies to Excel 2019, 2016, 2013, Excel for Mac, and Excel Online.

What Are Legend Keys?

To add to the confusion between legends and keys, Microsoft refers to each individual element in a legend as a legend key. A legend key is a single colored or patterned marker in the legend. To the right of each legend key is a name identifying the data represented by the specific key.

Excel screenshot showing a graph with a legend.

Depending on the type of chart, the legend keys represent different groups of data in the accompanying worksheet:

  • Line Graph, Bar Graph, or Column Chart: Each legend key represents a single data series. For example, in a column chart, there might be a blue legend key that reads Favorite Snacks Votes next to it. The blue colors in the chart refer to the votes for each entry in the Snacks series.
  • Pie Chart or Circle Graph: Each legend key represents only a portion of one data series. To use the same example from above, but for a pie chart, every cut of the pie is a different color that represents each "Snacks" entry. Every portion of the pie is a different size of the whole circle to represent the vote differences taken from the "Votes" series.

Editing Legends and Legend Keys

In Excel, legend keys are linked to the data in the plot area, so changing the color of a legend key will also change the color of the data in the plot area. You can right-click or tap-and-hold on a legend key, and choose Format Legend, to change the color, pattern, or image used to represent the data.

Excel screenshot showing how to insert a legend

To change options related to the whole legend and not just a specific entry, right-click or tap-and-hold to find the Format Legend option. This is how you change the text fill, text outline, text effect, and text box.

How to Show the Legend in Excel

After making a chart in Excel, it's possible that the legend doesn't automatically show. You can enable the legend by simply toggling it on. Here's how:

  1. Select your existing chart.

  2. Select Design.

  3. Select Add Chart Element.

  4. Select Legend.

  5. Choose where the legend should be placed — right, top, left, or bottom. There's also a More Legend Options > Top Right if you prefer.

If the option to add a legend is grayed out, it just means that you need to select data first. Right-click the new, empty chart and choose Select Data, and then follow the on-screen instructions to choose the data that the chart should represent.

Was this page helpful?