How to Graph Two Independent Variables in Excel

Charts & pivot tables · Updated November 23, 2026

Graphing two independent variables in Excel lets you visualize how two different inputs affect a single outcome. The most effective way is to use a scatter plot with two data series, where each series shares the same X-axis (the first independent variable) but has its own Y-values (the second independent variable and the outcome). This guide shows you how to set up your data and create the chart step by step.

What You’ll Need

  • Microsoft Excel for Microsoft 365 (steps are similar for Excel 2021, 2019, and 2016; Mac and web differences noted where relevant)
  • Your data organized in columns: one column for the first independent variable (e.g., Time), one column for the second independent variable (e.g., Temperature), and one column for the dependent variable (e.g., Output). Each row should represent a single observation.

Step-by-Step

  1. Prepare your data layout. Place your first independent variable in column A (e.g., A2:A20), the second independent variable in column B (e.g., B2:B20), and the dependent variable in column C (e.g., C2:C20). Include headers in row 1 for clarity. Example: A1 = “Time (hr)”, B1 = “Temperature (°C)”, C1 = “Output”.
  2. Select the data for the first series. Click and drag to select the range for the first independent variable and the dependent variable—but not the second independent variable. For example, select A1:A20 and then hold Ctrl (Cmd on Mac) and select C1:C20. This selects two non-adjacent columns.
  3. Insert a scatter chart. Go to the Insert tab on the ribbon. In the Charts group, click the scatter plot icon (it looks like a cluster of dots). Choose the first option, Scatter, which shows points only. Excel creates a chart with the first independent variable on the X-axis and the dependent variable on the Y-axis.
  4. Add the second series. Right-click on the chart area and select Select Data. In the Select Data Source dialog, click the Add button. In the Edit Series dialog, enter a name for the series (e.g., “Temperature Effect”) or click the range selector next to Series name and select a cell with the header. For Series X values, select the same first independent variable range (e.g., A2:A20). For Series Y values, select the second independent variable range (e.g., B2:B20). Click OK twice.
  5. Format the chart. Now you have two series plotted against the same X-axis. To distinguish them, click on one series to select it, then go to the Format tab (or right-click and choose Format Data Series). Change the marker style, color, or size. Repeat for the other series.
  6. Add axis labels and a title. Click on the chart, then click the Chart Elements button (the plus sign at the top-right corner). Check Axis Titles and Chart Title. Click on each text box to edit: X-axis title = first independent variable name, Y-axis title = “Value” or the dependent variable name, and chart title = something descriptive like “Effect of Time and Temperature on Output”.
  7. Adjust axes if needed. If the two independent variables have very different scales, you might want to use a secondary axis for the second series. Right-click the second series, choose Format Data Series, and under Series Options, select Secondary Axis. This places the second series on a separate Y-axis on the right side, making both trends visible.

Common Mistakes

  • Plotting both independent variables on the X-axis. Excel scatter plots only allow one X-axis per series. If you select both columns as X values, you’ll get a mess. Always use the same X range for both series.
  • Using a line chart instead of a scatter plot. Line charts treat categories as evenly spaced, which distorts continuous data. Scatter plots are correct for numeric independent variables.
  • Forgetting to include headers in the selection. If you select headers, Excel might interpret them as data points. Make sure your selection excludes headers unless you’re using them for series names.
  • Not aligning rows. Each row must represent a single observation. If your two independent variables are in different orders, the chart will be meaningless. Sort your data so that rows match.

Tips

  • Use a bubble chart for three variables. If you want to visualize three independent variables, consider a bubble chart where the bubble size represents the third variable. To create one, select all three columns and insert a bubble chart from the Insert tab.
  • Add a trendline. To see the relationship, right-click a series and choose Add Trendline. For linear relationships, choose Linear. This helps interpret the effect of each independent variable.
  • Use consistent colors. Assign a distinct color to each series to avoid confusion. You can change colors in the Format Data Series pane.
  • Label data points. If you have few points, add data labels by clicking the Chart Elements button and checking Data Labels. This makes the chart easier to read.

Troubleshooting

  • Only one series appears. This usually means you didn’t add the second series correctly. Go to Select Data and check that both series are listed. If the second series has no visible points, check that the X and Y ranges are correct and that the data is numeric.
  • The X-axis shows numbers instead of dates. If your first independent variable is a date, Excel might display it as a serial number. Right-click the axis, choose Format Axis, and under Number, set the format to Date.
  • The chart looks like a line, not points. This happens if you chose a line chart instead of a scatter plot. Delete the chart and re-insert using the scatter option. Or, right-click the series, choose Change Series Chart Type, and select Scatter.
  • Points are all on top of each other. This indicates that your independent variables have very different scales, and the smaller-scale series is compressed. Use a secondary axis as described in Step 7, or normalize your data (e.g., divide by the maximum) to make both visible.

Frequently Asked Questions

Q: Can I graph two independent variables on the same chart without using a scatter plot?
A: Yes, you can use a line chart, but it’s not recommended for continuous data because it treats categories as evenly spaced. Scatter plots are the standard for numeric independent variables.

Q: How do I add a third independent variable?
A: Use a bubble chart. Select all three columns (X, Y, and size) and insert a bubble chart from the Insert tab. The bubble size represents the third variable.

Q: What if my independent variables are categorical (e.g., gender, color)?
A: For categorical variables, use a clustered column chart or a stacked bar chart. Place one variable on the X-axis and group by the other using the Switch Row/Column option in the chart design.

Q: Why does my second series not show on the chart?
A: Check that you selected the correct ranges in the Edit Series dialog. Also, ensure the values are numeric and not text. If the values are very small relative to the first series, they might be hidden; use a secondary axis.

Q: Can I create this chart in Google Sheets?
A: Yes, the process is similar. Select the data, go to Insert > Chart, and choose Scatter chart. Then use the Customize tab to add a second series.

Q: How do I save this chart as a template?
A: Right-click the chart and select Save as Template. This saves the formatting and series settings so you can reuse them for future data.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.