Friday, August 5, 2016

MS Excel 2007: Create a chart with two Y-axes and one shared X-axis

Question: How do I create a chart in Excel that has two Y-axes and one shared X-axis in Microsoft Excel 2007?
Answer:First, select the Insert tab from the toolbar at the top of the screen. In the Charts group, click on the Column button and select the first chart (Clustered Column) under 2-D Column.
Microsoft Excel
A blank chart object should appear in your spreadsheet. Right-click on this chart object and choose "Select Data..." from the popup menu.
Microsoft Excel
When the Select Data Source window appears, we need to enter the data that we want to graph. In this example, we want column A to represent our X-axis and column C to represent our primary Y-axis (left side) and column E to represent our secondary Y-axis (right side). One more complication to this example is that our data is not all in adjacent cells, so we need to select columns A, C, and E separated by commas.
To do this, highlight cells A2 to A7 then type a comma, then highlight cells C2 to C7, then type another comma, and the highlight cells E2 to E7. You should see the following in your Chart data range box:
=Sheet1!$A$2:$A$7,Sheet1!$C$2:$C$7,Sheet1!$E$2:$E$7
Click on the OK button.
Microsoft Excel
Now, right-click on one of the data points for Series2 and select "Change Series Chart Type" from the popup menu.
Microsoft Excel
When the Change Chart Type window appears, select the 4th chart under the Line Chart section. Click on the OK button.
Microsoft Excel
Now when you view the chart, you should see that Series 2 has changed to a line graph. However, we still need to set up a secondary Y-axis as Series 2 is currently using the primary Y-axis to display its data.
To do this, right-click on one of the data points for Series 2 and select "Format Data Series" from the popup menu.
Microsoft Excel
When the Format Data Series window appears, select the "Secondary Axis" radio button. Click on the Close button.
Microsoft Excel
Now, if you want to add axis titles, select the chart and a Layout tab should appear in the toolbar at the top of the screen.
Click on the Layout tab. Then select Axis Titles > Primary Horizontal Axis Title > Title Below Axis.
Microsoft Excel
An Axis Title at the bottom of the graph should appear, just overwrite "Axis Title" with the text that you'd like to see.
Next, under the Layout tab in the toolbar, select Axis Titles > Primary Vertical Axis Title > Horizontal Title.
Microsoft Excel
An Axis Title to the left of the graph should appear, just overwrite "Axis Title" with the text that you'd like to see.
Next, under the Layout tab in the toolbar, select Axis Titles > Secondary Vertical Axis Title > Horizontal Title.
Microsoft Excel
Now, you should see that your chart is designed with a common X-axis and 2 different Y-axes.
Microsoft Excel