Tips on Graphing with Excel

How do I add a trendline / line of best fit / regression line to a chart?

  1. Make a chart. Then, click anywhere on the chart.
  2. The word Data in the top menu bar of Excel should change to Chart.
  3. Click on Chart, and select Add Trendline…
  4. Select the Linear option, and click OK.
  5. The trendline will be added to your chart.
  6. OPTION: If you click the Options tab, you will be able to check the box for Display equation on chart. If you do, the regression equation for the trendline will be printed. It may be useful in forecasting. If you don’t like where the equation shows up, click and drag it to a convenient place in the chart.

How do I get a line graph to compare two variables, the way a scatterplot does?


Line charts in Excel, along with column, bar, and area charts, are preset to treat the data you highlight as the dependent variable(s) or the Y axis series. To treat one variable as the category or X axis, do the following either as you first make a chart, or after clicking on an existing chart and then the Chart Wizard (Graph) button: wpe1.jpg (1132 bytes)

  1. Select the chart type you want, say, Line. Click Next.
  2. Click the Series tab at the top. In the Series box, click on the series that you want to use as the Category or X axis. Click the Remove button.
  3. In the Category (X) axis label box at the bottom, type in the cell address of the category variable. If you prefer, click the tiny red arrow at the right of that box, highlight the column of data in the worksheet for the category variable, and click the down red arrow in the pop-up dialog box. Excel will insert the cell address for you.
  4. Click Next, and add labels as usual.

How do I draw a histogram, with the bars touching?

  1. Histogram is found under Data Analysis… on the Tools menu, rather than under charts. This tool will do a frequency distribution and then graph it for you. Find and select Histogram.
  2. Enter the Input Range: by typing or highlighting the cells with the data you wish to analyze and chart. The Bin Range is optional.
  3. Check the Chart Output box, and click OK.
  4. Excel will provide a frequency distribution, and a chart. The bars will not be touching, though.
  5. To make the bars touch, double-click on any of the bars. In the resulting Format Data Series dialog box, click the Options tab.
  6. Set Gap width to 0. Click OK.

Copyright Paul Young, 2000