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

Excel users are frequently interested in how to graph a linear equation or a function in Excel. Fortunately, this is simple to accomplish using Excel’s built-in formulae. This lesson shows you how to visualize equations/functions in Excel.


What Is a Linear Equation?

A linear equation is a two-variable equation that produces a straight line when plotted on a graph. A one-degree equation is another name for it. A linear equation with two variables is of the following form:

Ax + By = C

How to Graph a Linear Equation in Excel: with Easy Steps

Step 1: Find Value of Dependent Variable

Assume we would like 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:

  • Imagine we were assigned the x values shown in the illustration. We have now input 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

  • Now, we have to drag the fill handle to complete the data range.

drag the fill handle


Step 2: Select Range and Choose a Suitable Graph Type

  • Then, select the values from B4 to C9. And 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

Sometimes, we may create a graph in Excel without utilizing data to observe the behavior of that graph.  In this section, we have discussed that.

📌 Steps:

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

an equation that has the following general formula

  • Now, in cell E5, type the formula:
=(B5*C5)+D5
  • Next, 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

  • First of all, select the range C4:C9.
  • Then, press and hold down the Ctrl key.
  • After that, select the range E4:E9.
  • The following figure will make it clear for you.

select the range

  • Subsequently, go to the Insert tab.
  • After that like the below image go to Scatter plot.

go to Scatter plot

  • As a result, you’ll obtain the graph. However, because we have an empty dataset, there will be no plotting for the time being.

How to Plot a Linear Equation in Excel Without Data

  • First of all, place the value of m as 5 for all the cases.
  • Then, type your desired values for the independent variable x.
  • Similarly, insert the value of c as 3.
  • Finally, apply the AutoFill tool to get the outcomes of the range E5:E9.
  • Hence, it’ll return the accurate outputs for the y variable.
  • Look at the below dataset to realize better.

insert the value

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


How to Add Equation to a Linear Graph of Excel

Using the Excel equation of a line, we may add an equation to a plot in Excel. Excel graph equation is simple to plot, and this article will lead all categories of Excel users through the procedure of displaying a linear equation and integrating it into a plot.

📌 Steps:

  • Our data will be tabulated in two columns. We will next 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, we will now 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, we will now add the chart’s equation by selecting “Display Equation on Chart.

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

  • Now 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 Practice Workbook

You can download the practice workbook from the following download button.


Conclusion

Follow these steps and stages to graph a linear equation in Excel. You are welcome to download the workbook and use it for your own practice. If you have any questions, concerns, or suggestions, please leave them in the comments section.


<< 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