3 ways to create vertical lines in an excel line chart

40
3 Ways to Create Vertical Lines in an Excel Line Chart

Upload: steveequalstrue

Post on 10-Apr-2017

33.637 views

Category:

Education


2 download

TRANSCRIPT

Page 1: 3 ways to create vertical lines in an excel line chart

3 Ways to Create Vertical Lines in an Excel Line Chart

Page 2: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 2

Adding Vertical Lines• What if you had this line chart and

wanted to add 2 vertical lines, one vertical line on Tuesday and one on Thursday.  In this presentation, you will learn how to add vertical lines to a standard Excel line chart.  There is also a video demonstration link at the end of the presentation.

Page 3: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 3

From Beginning to End• You will start

with a standard line chart

• and here is what the final chart should look like:

Page 4: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 4

Setup Your Data• Create a spreadsheet with this data

Page 5: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 5

Vertical Lines – Way 1 of 3• Add a Vertical Line using Excel Shapes

• The 1st and typically easiest way to Add a Vertical Line to an Excel Line Chart is to just draw an Excel Shape of a Line on top of the Excel Line Chart.

Page 6: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 6

1. Create your Excel Line Chart2. Select Insert Ribbon3. Select Shapes in the Illustrations

Group4. Select the Line without arrows in the

line section5. Draw your Line on top of the Excel

Line Chart you have already created.6. With the Line selected, Press

CTRL+1 to format the Excel Shape7. Change the Width to 3pt8. Change the Line Color to Red Animated Demonstration Visible in Slide Show

ModeThis is really the easiest way to add a line, HOWEVER, the line is not very dynamic and may get “OUT OF LINE” if you will when you add new data points to your line chart.  So you will have to constantly adjust the line as the chart adjusts.

Page 7: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 7

Vertical Lines – Way 2 of 3

• Add an Additional Column Series

• This is my recommended way to quickly and easily add as many vertical lines as you want to your Excel Line Chart.  It is dynamic and can be controlled with formulas and it will move and adjust as you add data points.

Page 8: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 8

Add Column Series – Step 1

• Add an additional column of data that will create an additional line series in your Excel Chart. You will see that I have added a data point for each day at a value of 12.  This is 20% above the real data because I want the vertical lines to go above the data and reach the maximum vertical position of the vertical axis. (Note, you will set this vertical axis maximum as detailed below.)

Page 9: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 9

Add Column Series – Step 2• Highlight the New Data Range and Create your Line chart.  You will

have 2 horizontal lines and your graph will look like the picture below.  Note, you can see the red horizontal line (titled Vertical Lines) because we have put a value for every day.  If we had only put a 12 on Tuesday and Thursday, we would not have seen the line because they would have been two data points that were not adjacent, thus it would not depict a line for you to easily see and select.

Page 10: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 10

Add Column Series – Step 3• Right Click on the Vertical Line Series.  In this case, the Red Data

Series.  Then from the Pop up menu, choose “Change Series Chart Type…"”

Page 11: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 11

Add Column Series – Step 4a• Change the Excel Chart Type to a 2-D Clustered Column Chart.

Page 12: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 12

Add Column Series – Step 4b• It will then look like this:

Page 13: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 13

Add Column Series – Step 5• We are getting very close.  Lets change a few things.  First, we wanted

to only have vertical lines at Tuesday and Thursday.  So lets delete the Vertical Lines data values from all days except Tuesday and Thursday.  Your chart will now look like this:

Page 14: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 14

Add Column Series – Step 6a• Now lets make the columns look more

like lines by changing some of their formatting.  First, right click on either column and then choose the “Format Data Series…” from the pop up menu.

• and then move the Gap Width slider to the right toward the Large Gap.  The farther right you move it, the smaller the column will appear.  It can get very small and will almost appear as a line.

Page 15: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 15

Add Column Series – Step 6b

• On a line chart with very few horizontal categories, the column will not get much thinner than this:

Page 16: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 16

Add Column Series – Step 6c• But when you more than

about 20 categories, the column will get very very thin and will appear as a line.  Compare these vertical columns/lines with the ones in the picture above.  You will see that they are thinner than the ones above, but the ones above are very acceptable to me.

Page 17: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 17

Add Column Series – Step 7a• Okay here is the final step

for the easy dynamic vertical lines.  Right click on the Primary Vertical Axis and then choose “Format Axis…” from the Excel pop up menu.

Page 18: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 18

Add Column Series – Step 7b• Then from the Format Axis

Dialog Box, you should change the Axis Options Maximum to 12 (equal to the amount you have in your vertical lines column.

Page 19: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 19

Add Column Series – Step 8• This will make the lines appear that they go

from the bottom of the vertical axis to the very top.  Here is your final chart.

Page 20: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 20

Add Column Series – 2 Colors• Here is the way to add one line for Tuesday and one line for Thursday.• a) Add another column of data for each line.  In the picture below, I

made the 2nd vertical line data set = 10 for each value so that you can discern each line individually.  If I set them both to 12, they would overlap and you would not be able to tell them apart as easily.  You can all ready see that the 2 lines have different colors.  Your data set and new line chart will look like this:

Page 21: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 21

Add Column Series – 2 Colors• Then you will have to change each series chart type to Clustered

Column Chart and follow each step from C thru F.  Also, you will want to change the values for the Vertical Line 2 data series back to 12 so that it will reach to the top of the chart.  When doing so, your chart will now look like this:

Page 22: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 22

Vertical Lines – Way 3 of 3• Add a Vertical Line using an XY Scatter Lines

• Okay, here is the 3rd way to add vertical lines to your Excel Line Chart.  There is a 4th way that I discovered, but it is a real pain in the you know what.  If you want to know more about this 4th way, you can see this on this post: Company and Industry P/E (Price to Earnings) Line Chart – 2 Ways

• The 3rd way is a little trickier to complete, but I am sure that if you follow my steps that you too will be able to do it.  This is a great technique to master because it will allow you to add any line to most 2D chart types.

Page 23: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 23

Add XY Series – Step 1 & 2• Create your Excel Line

Chart with the original set of data that looked like this:

• Now create 2 sets of data anywhere in your Excel Spreadsheet that looks like this:

Page 24: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 24

Add XY Series – Step 3a• Now I recommend that

you highlight and COPY the Tuesday data from the upper right hand corner down one cell to the 12.  Your range would look like this:

• then Select your Chart and select “Paste Special” from the Home Ribbon.  You will then see this Dialog Box:

Page 25: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 25

Add XY Series – Step 3b

• Then click on OK and your chart will now look like this:

Page 26: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 26

Add XY Series – Step 4

• Then click on OK and your chart will now look like this:

Page 27: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 27

Add XY Series – Step 4• Now you may say that this is NOT a vertical line.  And you are

correct .  However, here is how we start the transformation to an XY Scatter Chart.  First, Right Click on the Vertical Line Series. In this case, the Red Data Series. Then from the Pop up menu, choose “Change Series Chart Type…"”

Page 28: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 28

Add XY Series – Step 5a

• and then change the chart type to an XY (Scatter) – Scatter with Straight Lines:

Page 29: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 29

Add XY Series – Step 5b• Your resulting chart will now look like this.  Doesn’t look any better,

but we are now very very close

Page 30: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 30

Add XY Series – Step 6a• Now select your chart and then from the

Design Ribbon, choose the “Select Data” button from the Data Group.

• and you will then see this dialog box.  You will then want to select “Series2” from the Legend Entries (Series) area.  then click on “Edit”

Page 31: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 31

Add XY Series – Step 6b• Now when you click edit, you

will see the Edit Series Dialog Box.  Give your series a title, so that you can easily recognize it in the future.  Then change the Series X Values to the X’s for Tuesday and change the Series Y Values to the Y’s for Tuesday.

• And then press OK but don’t close down the “Select Data Source” dialog box as you need it in the next step.  Now looking at the chart, you will see a Vertical Red Line in your Excel Line Chart.

Page 32: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 32

Add XY Series – Step 7a• Now we have only created one

line, so lets create the 2nd line.  To do this, you need to ADD an new series in the Select Data Source dialog box.

Page 33: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 33

Add XY Series – Step 7b• From the Edit Series dialog box,

add the Thursday vertical line data by adding the X’s and the Y’s like this:

Page 34: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 34

Add XY Series – Step 7c• then go ahead now and click on

the OK from the “Select Data Source” dialog box.  IMPORTANT: if you click “Cancel” at this step, you will have to start over editing BOTH XY data series as Excel will think you want to start over with the edit of all series for the chart since you stated to edit them.

Page 35: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 35

Add XY Series – Step 7d• Your chart will now look like

this:

Page 36: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 36

Add XY Series – Step 8• Click on the Horizontal Secondary Horizontal Axis and press the

delete key on your keyboard and then select the Secondary Vertical Axis and press your delete key.  And boom goes the dynamite and you get this chart:

Page 37: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 37

Add XY Series – Step 9a• Okay here is the final step for the actual vertical lines. Right click

on the Primary Vertical Axis and then choose “Format Axis…” from the Excel pop up menu.

Page 38: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 38

Add XY Series – Step 9b• Then from the Format Axis Dialog Box, you should change the Axis

Options Maximum to 12 (equal to the amount you have in your vertical lines data.

Page 39: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 39

Add XY Series – Final Chart• This will make the lines appear that they go from the bottom of the

vertical axis to the very top. Here is your final chart:

Page 40: 3 ways to create vertical lines in an excel line chart

05/02/2023 Creating Simple Vertical Lines in an Excel Line Chart 40

 Video Tutorial

• Creating Simple Vertical Lines in an Excel Line Chart

• Excel Dashboard Templates

Other Step-by-Step and Video Demonstrations