How to Graph a Linear Equation in Excel (with Easy Steps)

Step 1 – Find the Value of the Dependent Variable

We want to graph the following equation: y = 3x + 5. The figure below explains how to produce the values of dependent variables for this linear equation in Excel, using an x-value range of 1 to 10:

  • We assign the x values shown in the illustration.
  • Insert the following equation to obtain the y values that correspond to the supplied x values:
y = 3x + 5

x values and insert y :how to graph a linear equation or a function in Excel

  • Drag the fill handle to complete the data range.

drag the fill handle


Step 2 – Select Range and Choose a Suitable Graph Type

  • Select the values from B4 to C9.
  • Choose the Insert tab.
  • Select the Scatter plot option from the Charts category.

Graph a Linear Equation in Excel

  • The corresponding plot will be generated automatically:

corresponding plot will be generated automatically

Read More: How to Display Equation of a Line in Excel Graph


How to Plot a Linear Equation in Excel Starting from No Data

Steps:

  • We will plot an equation that has the following general formula:
y= m*x + c

an equation that has the following general formula

  • Enter the following formula cell E5:
=(B5*C5)+D5
  • Press Enter. Because we haven’t yet entered the cell values, it will return 0.

haven't yet entered the cell values, it will return 0

  • Select the range C4:C9.
  • Press and hold down the Ctrl key.
  • Select the range E4:E9.

select the range

  • Go to the Insert tab.
  • Go to the Scatter plot.

go to Scatter plot

  • You’ve made the graph. However, because we have an empty dataset, there will be no plotting for now.

How to Plot a Linear Equation in Excel Without Data

  • Place the value of m as 5 for all the cases.
  • Type your desired values for the independent variable x.
  • Insert the value of c as 3.
  • Apply the AutoFill tool to get the outcomes of the range E5:E9.
  • It’ll return the accurate outputs for the y variable.

See the dataset below.

insert the value

Read More: How to Graph an Equation in Excel Without Data


How to Add a Equation to a Linear Graph of Excel

Steps:

  • Our data will be tabulated in two columns. We will pick the “scatter chart” button to display a graph after selecting our complete table and clicking “insert.”

selecting our complete table and clicking "insert."

  • To edit our graph,
  • Click on the “+” symbol next to the chart and then Trendline to More Options…

we will now click on the "+" symbol

  • After the sidebar appears in Excel, add the chart’s equation by selecting “Display Equation on Chart.

add the chart's equation finally by selecting "Display Equation on Chart."

  • The equation of the formula appears in the graph shown in the red box. This usually helps the users when they are bound to demonstrate only graphs in their projects.

the equation of the formula appears in the graph

Read More: How to Graph Two Equations in Excel


Download the Practice Workbook

You can download the workbook to practice


<< Go Back to Plot an Equation | Excel Charts | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Al Ikram Amit
Al Ikram Amit

Al Ikram Amit, holding a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, serves as a key Excel & VBA Content Developer at ExcelDemy. Driven by a profound passion for research and innovation, he actively immerses himself in Excel. In his role, Amit not only skillfully addresses complex challenges but also exhibits enthusiasm and expertise in gracefully navigating tough situations, emphasizing his steadfast commitment to consistently delivering exceptional, high-quality content that adds significant... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo