Sub topic 4
Inserting a Chart from a Selected Range
This chapter assumes you can navigate workbooks and worksheets, select ranges, and find tabs on the ribbon. It also assumes you have read the previous chapters on data layout and on series, categories, and values. Here you will turn a selected range into a chart, see how Excel decides what to plot, and fix the common mistakes.
The basic workflow
Inserting a chart takes three steps: select the data, choose a chart type, and review the result. Excel makes most decisions for you from the shape of the selection, so the selection is the most important step.
We will use this range in cells A1:B5:
Region Sales
North 120
South 95
East 140
West 80To insert a chart:
- Click any cell inside the range, or drag from A1 to B5.
- Open the Insert tab.
- In the Charts group, click a chart type button, such as Insert Column or Bar Chart.
- Pick a subtype from the gallery, such as Clustered Column.
Excel places the chart on the active worksheet as an embedded chart. An embedded chart is a chart object that floats over the cells and can be moved and resized without changing the data.
Selecting the range
You have two options. Each works in different situations.
- Click one cell inside a contiguous block. Excel expands the selection to the surrounding block of data, bounded by blank rows and columns. This is fast and works when your data is a clean block with no stray cells nearby.
- Select the exact range. Drag across the cells, or use Ctrl+A inside a block. This is safer when the sheet holds notes, totals, or other data next to the block.
Include the header row and the category column in your selection. Excel uses the header cells as series names and the first column as category labels. If you leave them out, Excel falls back to generic names such as "Series1" and uses numbers 1, 2, 3 for categories.
Selecting non-adjacent data
Sometimes the data you want is not side by side. For example, you may want Region in column A and Profit in column D, skipping the columns between them. Select the first block, hold Ctrl, and select the second block. Both blocks must have the same number of rows, and the selections should line up. Then insert the chart as usual.
How Excel decides what to plot
When you insert a chart, Excel applies a set of rules to decide which cells are categories, which are values, and whether series run down columns or across rows.
The rules, in simplified form:
- A column or row of text at the left or top is treated as category labels.
- Cells that hold numbers become values, grouped into series.
- If the selection has more rows than columns, each column becomes a series. If it has more columns than rows, each row becomes a series.
- If the top-left cell is empty, Excel is more confident that the first row and column are labels.
The diagram shows the decision path.
These rules usually give the right answer. When they do not, you can change them after the chart exists.
Using Recommended Charts
On the Insert tab, Recommended Charts opens a dialog with previews built from your actual data. The dialog lists chart types that Excel thinks suit the selection. It is a quick way to compare how the same data looks as a column chart and as a pie chart. Click a preview, then OK to insert it.
Treat the recommendation as a starting point. Excel judges the shape of the data, not your question. A recommended chart may be technically valid but wrong for what you want to show. A later chapter covers choosing a chart type.
You can also press Alt+F1 to insert a default chart, usually a clustered column, on the current sheet. F11 creates the default chart on its own new chart sheet.
Embedded charts and chart sheets
A chart can live in two places.
| Location | How to get it | Best for |
|---|---|---|
| Embedded chart | Insert tab, or Alt+F1 | Dashboards and reports where the chart sits next to its data |
| Chart sheet | F11, or **Move Chart** then **New sheet** | Full-page charts and printing one chart per page |
To move an existing chart, right-click it, choose Move Chart, and pick New sheet or Object in a worksheet. The chart keeps its data link either way.
The same range, different chart types
The same selection can produce different charts. Once you understand the selection, the chart type is mostly a menu choice.
| Button in the Charts group | Subtype to pick | What you get from A1:B5 |
|---|---|---|
| Insert Column or Bar Chart | Clustered Column | Four vertical columns, one per region |
| Insert Column or Bar Chart | Clustered Bar | Four horizontal bars, one per region |
| Insert Line or Area Chart | Line | A line through four points |
| Insert Pie or Doughnut Chart | Pie | Four slices that sum to the total |
Later chapters build each type in detail. At this stage, notice that all four use the same series (Sales) and the same categories (the regions). Only the visual encoding changes.
You can switch type at any time. Select the chart, then on the Chart Design tab click Change Chart Type. Pick a new type and click OK. Formatting that you applied may be kept or reset, depending on the type.
Fixing a chart that plots the wrong thing
Three problems account for most bad first charts.
A numeric column is plotted as a category
If your first column holds numbers, such as years (2022, 2023, 2024), Excel may treat it as a second series instead of as categories. The chart then shows a bar for "Year" next to the bar for your real data.
Fix it in one of two ways:
- Change the year headings to text, for example by typing an apostrophe before each year.
- Open Select Data, remove the "Year" series, and edit Horizontal (Category) Axis Labels so that they point to the year cells.
Series run the wrong way
If each row should be a series but Excel made each column a series, select the chart and click Chart Design, then Switch Row/Column. Excel swaps the two roles without changing your data.
Blank rows or stray cells are included
If the selection spans a blank row or a total row, the chart includes a gap or a "Total" bar that dwarfs the other values. Select the exact range again, leaving out the total row. A total belongs in the sheet, not in the chart of its own parts.
Where the chart gets its data
An inserted chart is linked to the cells it was built from. Change a number in B2, and the matching column updates. Behind the scenes each series stores a formula, which you can see by clicking the series and reading the formula bar:
=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$5,Sheet1!$B$2:$B$5,1)The four arguments are the series name, the category labels, the values, and the plot order. This is the same structure covered in the chapter on series and categories. Knowing it helps when a chart behaves oddly, because you can read exactly which cells it uses.
Adding a new row below row 5 does not extend the chart automatically. A later chapter shows how an Excel Table solves this.
Inserting a chart with VBA
You can create the same chart in code. This is optional here and is covered fully in a later chapter, but the macro below shows the same ideas: a source range, a chart type, and a location.
Sub InsertSalesChart()
Dim co As ChartObject
Set co = ActiveSheet.ChartObjects.Add(Left:=100, Top:=50, Width:=400, Height:=250)
With co.Chart
.SetSourceData Source:=ActiveSheet.Range("A1:B5")
.ChartType = xlColumnClustered
.HasTitle = True
.ChartTitle.Text = "Sales by Region"
End With
End SubSetSourceData plays the role of the selection you made by hand. ChartType plays the role of the gallery choice.
Exercises
Exercise
You select A1:B5, where A1 is "Region" and B1 is "Sales", and insert a column chart. The chart shows generic labels 1, 2, 3, 4 on the horizontal axis and the series is named "Series1". What most likely went wrong in your selection, and how do you fix it?
Show answer
The selection probably left out the header row and the category column, so Excel had no text to use as series names or category labels. Reselect a range that includes the header row and the Region column (A1:B5) and insert the chart again. Alternatively, open Select Data and edit the series name and the horizontal axis labels to point at B1 and A2:A5.
Exercise
A table has years in column A (2022, 2023, 2024) and revenue in column B. After inserting a column chart, you see two series, "Year" and "Revenue". Give two ways to fix it.
Show answer
Excel read the years as numeric values. Either convert the years to text (for example, with a leading apostrophe) so Excel treats them as categories, or open Select Data, remove the "Year" series, and set the horizontal axis labels to A2:A4 (the year cells).