The fastest way to calculate mean absolute deviation (MAD) in Excel is the built-in AVEDEV function. Click an empty cell, type =AVEDEV(A2:A8) with your own range, and press Enter. Excel returns the average distance of each value from the mean, in the same units as your data. For another practical use of SUMPRODUCT, see how to do integration in Excel with the trapezoidal and Simpson’s rules.
This guide shows AVEDEV with a worked example you can check, the manual helper-column method, two one-cell formulas, how MAD differs from standard deviation and median absolute deviation, and the mistakes that give wrong answers.
What mean absolute deviation measures
Mean absolute deviation tells you how spread out your numbers are. You find the mean, measure how far each value is from it (ignoring whether it’s above or below), then average those distances. In math notation:
MAD = Σ|x − mean| / n
Here x is each value and n is how many values you have. A small MAD means the values sit close to the average. A large MAD means they’re scattered. Because the distances are absolute values, MAD is never negative, and it’s in the same units as the data: if your data is in dollars, so is the MAD.
Method 1: Use the AVEDEV function
Microsoft’s AVEDEV function page describes it as returning “the average of the absolute deviations of data points from their mean.” That is exactly mean absolute deviation. It works in Excel for Microsoft 365, Excel 2024, 2021, 2019 and 2016, on Windows and Mac.
- Enter your numbers in one column, for example A2 to A8.
- Click the cell where you want the result.
- Type
=AVEDEV(A2:A8). - Press Enter.
Worked example
Use Microsoft’s own sample data so you can check your result. Type these seven values into A2:A8:
| Cell | Value | Distance from mean (4.857) |
|---|---|---|
| A2 | 4 | 0.857 |
| A3 | 5 | 0.143 |
| A4 | 6 | 1.143 |
| A5 | 7 | 2.143 |
| A6 | 5 | 0.143 |
| A7 | 4 | 0.857 |
| A8 | 3 | 1.857 |
The mean is 34 divided by 7, or about 4.857. The distances add up to about 7.143, and 7.143 divided by 7 is 1.020408. =AVEDEV(A2:A8) returns 1.020408, which matches Microsoft’s example. In plain terms, a typical value in this set is about one unit away from the average.

Several ranges at once
AVEDEV accepts 1 to 255 arguments, so you can combine ranges that aren’t next to each other: =AVEDEV(B2:B7,E2:E7) treats both ranges as one data set.
How AVEDEV handles blanks, text and zeros
This is the detail that trips people up. According to Microsoft, when you give AVEDEV a range, any text, logical values (TRUE or FALSE) and empty cells in it are ignored, but cells containing zero are included.
- If A9 is empty,
=AVEDEV(A2:A9)still returns 1.020408. The blank is skipped. - If A9 contains 0, the same formula returns 1.5. The zero is a real data point, so it pulls the mean down and adds a large distance.
So leave a cell empty when a value is missing, and type 0 only when the true value is zero. Don’t fill blanks with zeros to “tidy up” the data: it changes both the mean and the MAD.
One more rule: values you type directly into the formula, rather than reference in cells, are counted, including logical values and numbers written as text. If your range contains no numbers at all, AVEDEV returns an error rather than a result.
Method 2: Calculate MAD step by step with a helper column
The manual method is useful when you want to see each distance, show your working for a class, or check the AVEDEV result. With your data in A2:A8:
- In C1, type the label Mean. In D1, type
=AVERAGE(A2:A8)and press Enter. You get 4.857143. - In B1, type the label Distance.
- In B2, type
=ABS(A2-$D$1)and press Enter. The ABS function returns a number without its sign, so a negative distance becomes positive. - Select B2 and drag the fill handle (the small square at the bottom right of the cell) down to B8.
- In C2, type the label MAD. In D2, type
=AVERAGE(B2:B8)and press Enter. You get 1.020408, the same as AVEDEV.

Two things make or break this method:
- Lock the mean cell. The dollar signs in
$D$1keep the reference fixed when you copy the formula down. If you write=ABS(A2-D1)instead, the copied formulas point at D2, D3 and so on, and the results are wrong. - Keep rows aligned. The formula in B2 must refer to A2, the formula in B3 to A3, and so on. If the helper column starts one row off, every distance is measured for the wrong value.
If your data has blank cells, delete the helper formula next to each blank. Otherwise ABS treats the blank as 0 and adds a distance that shouldn’t be there.
Method 3: One-cell formulas without a helper column
AVERAGE and ABS as an array formula
You can do the whole calculation in one cell:
=AVERAGE(ABS(A2:A8-AVERAGE(A2:A8)))
The inner AVERAGE finds the mean, the subtraction measures each value’s distance from it, ABS removes the signs, and the outer AVERAGE averages the distances. In Excel for Microsoft 365 and Excel 2021 or later, just press Enter. In older versions such as Excel 2019 and 2016, press Ctrl + Shift + Enter instead, or the formula won’t calculate correctly. Microsoft’s guidelines for array formulas explain the difference between the two kinds. The result is a single number, so nothing spills into other cells.
SUMPRODUCT version
If you share files with people on older Excel and don’t want to rely on Ctrl + Shift + Enter, use SUMPRODUCT, which handles arrays on its own:
=SUMPRODUCT(ABS(A2:A8-AVERAGE(A2:A8)))/COUNT(A2:A8)
SUMPRODUCT adds up all the distances, and COUNT divides by the number of values. The SUMPRODUCT function is the same one used to calculate a weighted average in Excel, so it’s worth knowing.
Watch out for blanks in one-cell formulas
Both one-cell formulas treat an empty cell inside the range as 0 when they subtract the mean. That adds a large false distance, so on a range with blanks they give a different (usually larger) result than AVEDEV. Microsoft notes that SUMPRODUCT treats non-numeric entries as zeros. Use these formulas only on ranges with no gaps, or use AVEDEV.
Which method should you use?
| Method | Best for | Blank cells |
|---|---|---|
=AVEDEV(A2:A8) | Quick, reliable answer in any recent Excel | Ignored |
Helper column with =ABS(A2-$D$1) | Showing each step, checking work, teaching | Counted as 0 unless you remove those rows |
=AVERAGE(ABS(A2:A8-AVERAGE(A2:A8))) | One cell, Microsoft 365 or Excel 2021 and later | Counted as 0 |
=SUMPRODUCT(ABS(A2:A8-AVERAGE(A2:A8)))/COUNT(A2:A8) | One cell that works the same in older Excel | Counted as 0 |
MAD vs standard deviation
Both measure spread, but they treat distances differently. Standard deviation squares each distance before averaging, then takes the square root. Squaring makes large distances count much more, so a single outlier raises the standard deviation more than it raises MAD.
For the example data, MAD is 1.02. The population standard deviation, from =STDEV.P(A2:A8), is about 1.25. Use STDEV.P when your data is the entire population, and STDEV.S when it’s a sample.
Choose MAD when you want a number that’s easy to explain (“values are about 1 unit from the average on average”). Choose standard deviation when you need it for further statistics, such as confidence intervals, or when a course or report asks for it. Neither can be negative.
MAD vs median absolute deviation
Both are often shortened to MAD, which causes confusion. Mean absolute deviation (AVEDEV) measures distances from the mean, so it’s still affected by outliers, just less than standard deviation. Median absolute deviation measures distances from the median and takes the median of those distances, which makes it much more resistant to extreme values.
Excel has no built-in function for median absolute deviation. You can build it from MEDIAN and ABS:
=MEDIAN(ABS(A2:A8-MEDIAN(A2:A8)))
Enter it the same way as the AVERAGE array formula above. For the example data, the median is 5 and this formula returns 1. Check which measure your teacher, textbook or report expects before you choose.
Common problems
- Your result doesn’t match AVEDEV. Look for blank cells in the range. AVEDEV skips them, but the helper column and one-cell formulas count them as 0.
- Every helper value looks wrong after the first row. The mean reference isn’t locked. Change it to
$D$1and copy the formula down again. - The array formula returns a wrong number in Excel 2019 or 2016. Select the cell, click in the formula bar, and press Ctrl + Shift + Enter.
- Numbers stored as text are skipped. If some numbers are left aligned, they may be stored as text. Convert them to numbers so AVEDEV includes them.
- You get an error. Check that the range contains at least one number and that the formula’s parentheses are balanced.
If a few extreme values are skewing your results, see how to find and remove outliers in Excel.
Questions
Is AVEDEV the same as mean absolute deviation?
Yes. AVEDEV returns the average of the absolute deviations from the mean, which is the definition of mean absolute deviation. It does not calculate median absolute deviation.
Can mean absolute deviation be zero?
Yes, but only when every value is the same, so every distance from the mean is zero. It can never be negative.
Should I use AVEDEV or the manual formula?
Use AVEDEV for everyday work: it’s shorter and handles blank cells correctly. Use the helper column when you need to show the steps or check a result by hand.
Matt Williams is the writer and editor behind TechInfoHome. He holds a degree in computer science and has more than 10 years of experience working in IT. For the past 5 years he has written online tutorials for Windows, Microsoft Office, Google apps and iPhone, with a focus on clear steps that get readers to a working fix quickly.