Area Under Curve (AUC) is a widely used concept in data sciences in multiple fields.
While the concept of Area Under Curve is quite simple (which is to calculate the total area covered between the curve/line and the axis), there is no direct way to calculate this in Excel.
For example, if you have a car’s speed recorded every few seconds, the area under that speed curve tells you how far the car traveled.
But it isn’t too difficult as well!
In this short tutorial, I will show you two ways you can use to calculate Area Under Curve in Excel: the trapezoid formula method and the chart trendline equation method.
So let’s get started!
Follow along with the example file
Area Under Curve in Excel.xlsx
Formula to Calculate Area Under Curve in Excel
As I mentioned, there is no direct formula to calculate AUC, but we can calculate it using a helper column and a simple formula.
Below I have a dataset of a car’s speed (in meters per second) recorded every 2 seconds, along with a chart of this data, and I want to calculate the area under this curve.

Since speed multiplied by time gives you distance, the area under this curve is the distance the car traveled in these 20 seconds.
While I can not calculate the area under the curve for this whole chart, I can break it down into small trapezoids (as shown below), and then calculate the area of each trapezoid.

In the above chart image, I have broken each interval into a separate section (indicated with a different color), and each of these sections resembles a trapezoid.
While I can not calculate the area under the line curve directly, I can calculate the area of these individual trapezoids.
Once I have the area for all of these trapezoids, I can just add them all. This will give me a very close value of the total area under the chart.
Below is the formula to calculate the area of a trapezoid:
A = (a + b)/2 * h
where:
- a is the length of one parallel side
- b is the length of the other parallel side
- h is the height (the distance between the two parallel sides)

In our chart, a and b are two speed readings next to each other, and h is the 2-second gap between them.
Below is the formula that I can use (in the adjacent column C) to calculate the area of every trapezoid in the chart for my dataset:
=(B2:B11+B3:B12)/2*(A3:A12-A2:A11)

How this formula works:
- B2:B11+B3:B12 adds each speed reading to the reading right after it, and dividing by 2 gives the average of the two (the (a + b)/2 part).
- A3:A12-A2:A11 subtracts each time from the next time, which gives the width of each interval (the h part). Here, every interval is 2 seconds.
- Multiplying the two gives the area of each trapezoid, and since this is a dynamic array formula, it spills down from C2 to C11 on its own.
Since the A3:A12-A2:A11 part uses the actual time gaps, this formula works even when your readings are not evenly spaced. Each trapezoid uses its own time gap.
Cell C12 stays empty, and that’s expected. There are 11 speed readings, so there are only 10 intervals between them, and the last reading has no next reading to pair with.
If you are using Excel 2019 or earlier, enter the below formula in cell C2 and then copy it down to C11 (leave C12 empty):
=((B2+B3)/2)*(A3-A2)
Now that I have the trapezoid value (which is also the area under the curve value) for the x-axis intervals in the chart, I can now add all these to get the overall area under the chart.
I can use a simple SUM formula to do this:
=SUM(C2:C11)

This gives 364, which means the car traveled about 364 meters in those 20 seconds.
So this is how I can calculate the total area under the curve for a simple chart like this.
If you do not need to see the area of each trapezoid, you can skip the helper column and get the total with one formula:
=SUMPRODUCT((B2:B11+B3:B12)/2,A3:A12-A2:A11)

The SUMPRODUCT function does the same math as the helper column and adds up the results, so it also returns 364. It works in all Excel versions, and you don’t need to press Ctrl + Shift + Enter.
Note that the result of this method would be very close to the actual area under curve value, but it could be slightly off.
This is because the real curve between two readings is not a perfect straight line, so the area under it is not a perfect trapezoid, but close to it.
The closer together your readings are, the smaller this difference gets.
Using the Trendline Equation for Area Under Curve
Let me show you another method to calculate the Area Under Curve (AUC) for a chart in Excel.
This method uses adding a trendline in the Excel chart and then utilizing the equation that the Excel chart automatically creates for the trendline.
Below is the same car speed dataset, and I have created a scatter chart using this data. Now I want to calculate the area under the curve for this chart.

Important: Use a scatter chart for this method, not a line chart. A line chart’s trendline treats the x values as 1, 2, 3 and so on instead of your actual time values, so the equation and the area would be wrong.
Below are the steps to get the Trendline equation for our dataset:
- Select the chart

- Click on the Chart Elements icon (the plus icon at the top right of the chart), hover the cursor over the Trendline option, and click on ‘More Options’. This will open the Format Trendline pane

If you don’t see the plus icon (for example, in some versions of Excel on a Mac), go to the Chart Design tab, click Add Chart Element, then Trendline, and then More Trendline Options.
- In the ‘Trendline Options’, select Polynomial (and leave the Order at 2)

- Check the ‘Display Equation on chart’ option. This will show a polynomial equation of the trendline in the chart

Now that we have the polynomial equation, we can use this to calculate the area for this chart.
But before doing that, there is one more step that you need to do. You need to get the integral for the polynomial equation.
In my case, the equation is:
y = -0.0778x² + 2.8059x + 0.5594
So the integral of this equation would be:
F(x) = (-0.0778/3)x³ + (2.8059/2)x² + 0.5594x + c
While I am not an expert in calculus, based on my limited understanding, you can convert an equation to an integral by increasing the power of x by 1, and dividing it by that same value power.
For example, x² will become x³/3 and x will become x²/2 and any constant (such as 1.85) will become 1.85x
You don’t need to worry about the + c at the end. It cancels out when you subtract one value of F(x) from another, which is what we do next.
Now that I have the equation, I can calculate the area under the curve by finding the value of F(20) – F(0), which is the integral at the end time minus the integral at the start time.
This difference is the area under the trendline curve between 0 and 20 seconds, so it’s the same distance the trapezoids estimated in the previous method.
You could type the numbers from the chart equation into a formula, but the chart rounds them to 4 decimal places. The LINEST function gives you the same three numbers at full precision, right in the worksheet.
Here is the formula I entered in cell D2, which returns the three numbers in D2:F2:
=LINEST(B2:B12,A2:A12^{1,2})

How this formula works:
- A2:A12^{1,2} gives the LINEST function two columns to work with, the time values and the time values squared. This is what makes it fit a curve (x²) instead of a straight line.
- The LINEST function returns the numbers in the same order as the chart equation: the x² number in D2, the x number in E2, and the constant in F2.
If you are using Excel 2019 or earlier, select D2:F2, enter the below formula, and press Ctrl + Shift + Enter:
=LINEST(B2:B12,A2:A12^{1,2})
Now I can calculate the integral at the start time. Here is the formula I used in cell I2:
=D2/3*A2^3+E2/2*A2^2+F2*A2

This is the F(x) equation from above, with the numbers from D2:F2 and x as the start time in A2. Since the start time is 0, the result is 0.
I’ve still kept this step because your data may not start at 0 (for example, if your readings start at 1 second, this value would not be 0).
And here is the formula for the integral at the end time in cell I3, which uses the end time in A12:
=D2/3*A12^3+E2/2*A12^2+F2*A12

To get the area under the curve, we need to find the difference between these two values [F(20) – F(0)]:
=I3-I2

This gives 364.92. If you had typed the rounded numbers from the chart instead, you would get 364.90, and this gap grows when your x values are large (because x gets cubed).
If you add more readings to your data, update the ranges in the LINEST formula and the end time cell (A12) in the formula in I3.
You will notice that the value is very close to the one we got from our previous method (364, by using the trapezoid formula).
While both these methods work fine, remember these are still a very close approximation of the area under the curve and are not exact.
The trapezoid method joins the readings with straight lines, while the trendline is a smooth curve that does not pass exactly through every reading.
So while Microsoft Excel does not have a direct way to calculate the area under the curve, you can use any of these two methods to do it.
I hope you found this tutorial useful!
Other Excel tutorials you may also like:
Excellent information for a person like me. Thank you.
Yes, good job – especially with the polynomial. Maybe a method of getting the exact area would be to average up each pair of Y axis values (1st pair would be the average of 0 and 3) and average those averages, then multiply with the x axis length (10 in this case). The exact area for this set is 428.
Would the next pair then be the average of 3 and 5 or the average of 5 and 12?
Good job. clear methods. Both correspond to integrating the curve graphical and analytical. Just a note: for the first ,method if you have negative values you need to use absolute values