Sub topic 11
Changing what a chart plots with Select Data
This chapter assumes you can select ranges, insert a basic column, bar, line, or pie chart, and tell series from categories. If those terms are unfamiliar, review the chapter on series, categories, and values first.
A chart is a view of a range. When the chart plots the wrong cells, the wrong series, or the wrong order, you fix it in the Select Data Source dialog instead of rebuilding the chart. This chapter covers what the dialog controls, how to use it, and the errors that come up most often.
What Select Data controls
Every chart stores a list of series. Each series points to three kinds of cells:
- A series name, usually a header cell. It appears in the legend.
- Series values, the numbers that set bar heights, line positions, or slice sizes.
- Category labels (also called horizontal axis labels), the text or dates that label each point.
Select Data lets you edit all three, add or remove series, reorder series, and swap rows for columns. It also controls how hidden cells are treated.
To open it, click the chart, then choose Chart Design > Select Data. You can also right-click the chart and choose Select Data.
The dialog has two panes:
| Pane | What it holds | Buttons |
|---|---|---|
| Legend Entries (Series) | One row per series | Add, Edit, Remove, Move Up, Move Down |
| Horizontal (Category) Axis Labels | The category labels shared by the chart | Edit |
At the top is the Chart data range box. It holds a single reference that describes the whole chart. At the bottom-left are Hidden and Empty Cells and Switch Row/Column.
How the series formula works
Click a series on the chart and look at the formula bar. You will see a formula like this:
=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$5,Sheet1!$B$2:$B$5,1)The four arguments are, in order:
- The series name cell,
Sheet1!$B$1. - The category labels,
Sheet1!$A$2:$A$5. - The values,
Sheet1!$B$2:$B$5. - The plot order,
1.
The Select Data dialog is a friendlier editor for this formula. Knowing the formula helps you read what the chart is doing, and you can edit it directly in the formula bar for quick fixes.
Changing the chart data range
The simplest change is to replace the range the chart reads.
- Click the chart and open Select Data.
- Click inside the Chart data range box. The worksheet shows a moving border around the current range.
- Drag across the new range on the sheet, including the header row and the category column.
- Click OK.
Excel rebuilds the series list from the new range. It decides what is a series and what is a category using its own rules, which can differ from what you intended. The next section covers that.
Switching rows and columns
Excel guesses the orientation of your data. With a small table it usually puts the longer dimension on the category axis. If you have four regions and three quarters, you might get regions as categories and quarters as series, when you wanted the opposite.
Click Switch Row/Column in the dialog to swap the two. The series become the categories and the categories become the series. The legend, colors, and grouping change accordingly.
Consider this range:
Region Q1 Q2 Q3
North 120 130 150
South 95 100 110
East 140 135 160
West 80 90 85- With regions as categories, the chart shows four groups of three columns. Use this to compare quarters within each region.
- After switching, the chart shows three groups of four columns. Use this to compare regions within each quarter.
Neither layout is wrong. Pick the one that answers your question.
The button can be disabled. This happens when the chart has several series whose values come from non-contiguous ranges. In that case, edit each series by hand, as described below.
Editing an existing series
Select a series in the Legend Entries (Series) pane and click Edit. A small dialog opens with two boxes:
- Series name: a cell reference such as
=Sheet1!$B$1, or typed text in quotes. - Series values: a range such as
=Sheet1!$B$2:$B$5.
Use the collapse button at the right of each box to select cells on the sheet. If you type a reference, keep the = sign and the sheet name.
To change the category labels, click Edit in the right pane and select the new label range. Category labels apply to the whole chart. If series have different labels, Excel uses the labels of the first series for the axis.
Adding and removing series
To add a series, click Add in the left pane. Enter a name cell and a values range. For example, to add a fourth quarter stored in column E:
- Series name:
=Sheet1!$E$1 - Series values:
=Sheet1!$E$2:$E$5
The new series must have the same number of points as the others, or the extra or missing points show as gaps.
To remove a series, select it and click Remove. This deletes the series from the chart only. The cells on the sheet are not touched.
A faster way to add data is to select the chart and look at the colored outlines on the worksheet. Dragging the corner handle of the range outline extends or shrinks the plotted range without opening the dialog.
Reordering series
The order in the left pane controls the order of columns within each group, the stacking order in stacked charts, and the order of legend entries. Select a series and use Move Up or Move Down.
On a pie chart there is one series, so reordering applies to the slices through the worksheet order. To change slice order, sort the source data.
Hidden and empty cells
Click Hidden and Empty Cells to open its settings.
| Setting | Effect |
|---|---|
| Show empty cells as: Gaps | Leaves a break in a line or no bar for blanks. This is the default. |
| Show empty cells as: Zero | Plots blanks as 0. A line drops to the axis. |
| Show empty cells as: Connect data points with line | Line charts only. Draws the line across the blank. |
| Show data in hidden rows and columns | Off by default. When off, hiding a row or column removes it from the chart. |
The hidden-cells behavior is useful. You can hide a column of the source table to remove that series from the chart without deleting anything. Unhide it to bring it back. It is also a common surprise: a chart that "lost" a series after someone filtered the table. Filtering hides rows, and hidden rows are not plotted unless you turn on Show data in hidden rows and columns.
A cell containing #N/A is treated differently from a blank. A line chart skips an #N/A point and connects its neighbors, which is a way to control gaps with a formula.
Common errors
- A numeric column appears as categories. If the header cell above a numeric column is empty, or the top-left cell of the range has content, Excel may treat the numbers as labels. Leave the top-left cell empty or make sure every column has a text header, then reselect the range.
- Years plotted as a series. A column of years such as 2023, 2024, 2025 is numeric, so Excel may plot it as a series. Open Select Data, remove the Year series, then edit the category labels to point at the year cells.
- The series values box shows
={1}. This means the reference is broken or was cleared. Re-enter the range. - Wrong sheet name after renaming or copying. A chart copied to another workbook keeps references to the original. Edit each series to point at the new data.
- Series of unequal length. The shorter series leaves empty space. Make the ranges the same size.
- Pie chart shows only one series. A pie always plots one series. If several exist, only the first is drawn. Remove the others or build separate pies.
A worked example
Suppose a chart shows Sales by Region in A1:B5, and you now want to compare it with a Target column in C1:C5.
- Click the chart and open Chart Design > Select Data.
- Click Add.
- For Series name, click cell
C1. - For Series values, select
C2:C5. Clear the default={1}first. - Click OK twice.
The chart now has two series. If you also want regions along the axis in a different order, sort the table and the chart follows.
Exercise
A line chart plots monthly revenue in column B, with years and months in column A. After you filter the table to show only 2025, the chart loses the other years. How do you keep all rows plotted while the filter stays on, and which dialog setting do you use?
Show answer
Open Chart Design > Select Data, click Hidden and Empty Cells, and check Show data in hidden rows and columns. Filtered rows are hidden, and Excel does not plot hidden rows by default, so enabling this setting keeps them in the chart.
Exercise
A chart of Sales by Region plots a Year column as a second series. What two edits in Select Data fix it?
Show answer
Select the Year series in the Legend Entries pane and click Remove. Then click Edit under Horizontal (Category) Axis Labels and select the cells that hold the years or the labels you want on the axis.