Reputation: 4512
Is there a way to plot a single horizontal line in excel using the value from a single cell? So without having to create a column filled with the same value for every point?
Edit: I'm trying to add the horizontal line to an existing lineplot
Upvotes: 1
Views: 15089
Reputation: 56
I created a new "Name" (Formulas/Name Manager) with the formula:
=SEQUENCE(1,[number of datapoints],[value that we want to plot],0)
Then we select the chart, go to Chart Design/Select Data, and Edit our Series. In Values, we need to add:
='[Sheet name]'![Name we gave to the "Name" we created]
This works for Charts of dynamic sizes, since we can use COUNT to know how many datapoints we have. It also updates when we change the value we want to plot.
Upvotes: 2
Reputation: 6418
You'll need to enter the value in the first and last row of data.
1) insert your chart
2) Right-click on it and choose "Select Data Source" from the drop-down menu
3) Select your series on the left hand side of the dialog box
4) Click on "Hidden and Empty Cells"
5) In the resulting dialog box, select "Connect data points with line
Upvotes: 1