How to Insert a Target Line in an Excel Graph
In this article
To insert a target line in an Excel graph, you must create a new data series where every cell contains the same target value, then add that series to your existing chart as a line. Because Excel graphs plot data points, a "line" is simply a series of identical values connected across your X-axis, creating a perfectly horizontal benchmark for comparison.
What You'll Need
- An existing Excel workbook with a data set.
- A chart already created (such as a Column or Line chart) that you wish to add the target line to.
- A small amount of empty space in your data table to create the target column.
Step-by-Step
- Create the Target Column: Go to the data table that feeds your graph. In the column immediately to the right of your actual data, create a new header titled "Target" or "Goal."
- Enter the Target Value: In the first cell under your new "Target" header, type the numerical value of your goal (e.g., 100).
- Fill the Column: Click the bottom-right corner of that cell (the fill handle) and drag it down to the bottom of your data set. Every row in this column must have the exact same number to ensure the line remains horizontal.
- Add Data to the Chart: Right-click anywhere on your existing chart and select Select Data... from the context menu.
- Add a New Series: In the "Select Data Source" window, click the Add button located under the "Legend Entries (Series)" section.
- Define the Series Name: Click in the "Series name" box, then click the cell containing your "Target" header in your spreadsheet.
- Define the Series Values: Clear the "Series values" box completely. Then, click and drag to select all the cells containing the target values you created in Step 3. Click OK on the Edit Series window, and OK again on the Select Data Source window.
- Change the Chart Type: If your original chart was a Column chart, the target will appear as another set of bars. To fix this, right-click on one of the new target bars and select Change Series Chart Type....
- Set to Line: In the "Change Chart Type" window, ensure you are on the Combo tab. Find your "Target" series in the list and change its "Chart Type" dropdown to Line. Keep the "Secondary Axis" box unchecked unless your target value is on a completely different scale than your primary data. Click OK.
- Format the Line: To make the target line stand out, right-click the line in the chart and select Format Data Series.... In the Format pane, use the "Fill & Line" (paint bucket) icon to change the color to red or make the line dashed to distinguish it from actual performance data.
Common Mistakes
- Using a Single Cell: Many users try to select only one cell for the target value. Excel requires a range of values that matches the number of categories on your X-axis; otherwise, the line will only appear as a single dot or not appear at all.
- Incorrect Series Values: Forgetting to clear the default
={1}in the Series values box before selecting your data range often leads to an error or a distorted line. - Wrong Chart Type: Adding the data but forgetting to switch the series type to "Line" results in cluttered bars that obscure the actual data.
- Overlapping Data: Placing the target column in a way that it gets automatically included in a "Sum" or "Average" calculation elsewhere in the sheet, which can lead to confusing totals.
Tips
- Dynamic Targets: Instead of typing the target number manually in every cell, type the target value in one single cell (e.g., cell E1). In your target column, enter the formula
=$E$1. Now, whenever you change the value in E1, the line on the graph will move automatically. - Data Labels: To make the target value obvious, right-click the very last point of the target line and select Add Data Label. You can then click the label to edit the text to say "Goal: 100."
- Zebra Striping: If you have multiple targets (e.g., a "Minimum" and a "Maximum"), repeat the process for a second column. Use a solid line for the maximum and a dotted line for the minimum for better visual clarity.
Troubleshooting
If the target line does not appear or looks incorrect, try these steps in order:
- Check for Blanks: Ensure there are no empty cells in your target column. A single blank cell will create a gap in the line.
- Verify Data Range: Go back to Select Data and ensure the "Series values" range exactly matches the number of rows in your primary data. If your primary data has 12 months but your target column only has 10 values, the line will stop short.
- Check Axis Scale: If the line is invisible, it may be plotted outside the current Y-axis range. Right-click the Y-axis, select Format Axis, and check if the "Maximum" bound is high enough to include your target value.
- Reset Chart Type: If the line looks like a jagged zig-zag, ensure all values in the target column are identical. If they vary, the line will follow those variations.
Frequently Asked Questions
Can I add a target line without adding a new column to my data?
Not natively. Excel charts are driven by data ranges. To have a line appear across the chart, there must be a corresponding set of data points in the spreadsheet to tell Excel where to draw the line.
Why is my target line appearing as a bar instead of a line?
This happens when the chart's default type is "Clustered Column." You must right-click the series and use Change Series Chart Type to specifically set the Target series to "Line."
How do I make the target line go across the entire background?
Ensure your target data column extends to the very last category on your X-axis. The line will only span the distance of the data points provided in the series range.
Can I use a target line in a Pie chart?
No. Target lines require a Cartesian coordinate system (X and Y axes). Pie charts represent parts of a whole and do not have axes, so a horizontal benchmark line is not mathematically possible in that format.
Will the target line update if I add new rows of data?
Only if you use an Excel Table (Ctrl+T). If your data is in a standard range, you will need to update the "Select Data" range to include the new rows. If you use a Table, the chart and the target series will expand automatically.