Excel Formula to Calculate Average Sales Excluding Standard Deviation Outliers

📅 Aug 09, 2026 📝 Sarah Miller

Sales forecasting often suffers from distorting anomalies, leaving analysts struggling to generate reliable baseline metrics. While standard AVERAGE functions or manual filters offer a basic starting point, they fail to isolate true performance trends from volatile spikes. Implementing a standard deviation filter grants your team unparalleled analytical precision, securing clean, representative data. Crucially, this methodology stipulates establishing strict threshold bounds-typically ±2 standard deviations from the mean-to prevent over-filtering. For example, nesting AVERAGEIFS with STDEV.S dynamically isolates baseline sales. Below, we provide the step-by-step formula architecture to master this technique.

Excel Formula to Calculate Average Sales Excluding Standard Deviation Outliers

Excel Formula to Aggregate Average Sales with Standard Deviation Outliers Excluded

When analyzing sales data, calculating a simple average often fails to tell the true story. A single massive wholesale order or an accidental data-entry typo can severely skew your metrics upward. Conversely, a temporary system glitch recording zero-dollar transactions can drag your averages down. To make informed business decisions, forecast accurately, and set realistic performance targets, you need a way to calculate a "clean" average sales figure.

One of the most robust statistical methods to achieve this is by excluding outliers based on Standard Deviation (SD). By establishing a boundary-typically two standard deviations from the mean-you can automatically filter out anomalies and aggregate only the representative core of your sales data.

In this guide, we will explore how to build Excel formulas to dynamically calculate this outlier-free average sales figure, ranging from modern dynamic array formulas to classic backwards-compatible methods.

---

The Statistics Behind Outlier Detection

In statistics, standard deviation measures the dispersion of a dataset relative to its mean. If your sales data follows a normal distribution (a bell curve):

  • 68.2% of your sales transactions will fall within ±1 standard deviation of the average.
  • 95.4% of your transactions will fall within ±2 standard deviations of the average.
  • 99.7% of your transactions will fall within ±3 standard deviations of the average.

A standard industry practice is to define any data point lying beyond two standard deviations (±2 SD) from the mean as an outlier. Our objective is to write an Excel formula that identifies this acceptable range dynamically and calculates the average of only the sales figures that fall inside it.

---

The Scenario Setup

Let's assume your raw sales transaction data is stored in column B, specifically in the range B2:B1001. The goal is to calculate the average of these sales, automatically excluding any value that is either:

  • Lower than: Average - (2 * Standard Deviation)
  • Higher than: Average + (2 * Standard Deviation)
---

Method 1: The Modern Excel Approach (Using LET and FILTER)

If you are using Microsoft 365 or Excel 2021+, the most elegant, readable, and computationally efficient way to solve this is by using the LET and FILTER functions. This approach allows us to define variables and perform the entire operation within a single cell without needing helper columns.

The Formula

=LET(
    sales_range, B2:B1001,
    avg_sales, AVERAGE(sales_range),
    std_dev, STDEV.S(sales_range),
    lower_limit, avg_sales - (2 * std_dev),
    upper_limit, avg_sales + (2 * std_dev),
    filtered_sales, FILTER(sales_range, (sales_range >= lower_limit) * (sales_range <= upper_limit)),
    AVERAGE(filtered_sales)
)

How It Works

  1. sales_range, B2:B1001: We assign our data range to a variable named sales_range so we don't have to repeatedly type the cell references.
  2. avg_sales, AVERAGE(...): Calculates the initial average of the entire raw dataset.
  3. std_dev, STDEV.S(...): Calculates the sample standard deviation. We use STDEV.S because sales transactions are typically a sample of a larger population.
  4. lower_limit & upper_limit: Establishes our statistical boundaries. Any sales value below the lower_limit or above the upper_limit is flagged as an outlier.
  5. filtered_sales, FILTER(...): This is where the magic happens. The FILTER function returns an array of numbers from our original range that meet our criteria. The asterisk (*) acts as an AND operator, ensuring each value is both greater than or equal to the lower limit and less than or equal to the upper limit.
  6. AVERAGE(filtered_sales): Finally, Excel calculates the average of this newly filtered, outlier-free array.
---

Method 2: The Classic Excel Approach (Using AVERAGEIFS and Helper Cells)

If you need your spreadsheet to be compatible with older versions of Excel (such as Excel 2013 or 2016), or if you prefer to visually audit your math step-by-step, the helper cell method is highly effective.

Step 1: Calculate the Statistical Metrics

Set up a small summary table in your spreadsheet to calculate the boundary thresholds:

Metric Excel Formula Cell Reference
Raw Average Sales =AVERAGE(B2:B1001) E2
Sample Standard Deviation =STDEV.S(B2:B1001) E3
Lower Boundary (-2 SD) =E2 - (2 * E3) E4
Upper Boundary (+2 SD) =E2 + (2 * E3) E5

Step 2: Apply the AVERAGEIFS Formula

With your boundaries calculated in cells E4 and E5, you can now use the AVERAGEIFS function to calculate your targeted average. Enter this formula in your destination cell:

=AVERAGEIFS(B2:B1001, B2:B1001, ">="&E4, B2:B1001, "<="&E5)

How It Works

The AVERAGEIFS function averages cells in a range that meet multiple specified criteria. Because Excel requires criteria expressions to be strings when using logical operators, we use the ampersand (&) to concatenate the operator with our helper cell references (e.g., ">="&E4).

---

A Concrete Example

To visualize how much of a difference this makes, let's look at a small sample dataset of 10 transactions. Imagine one of your sales representatives accidentally keyed in a transaction as $10,000 instead of $100:

Transaction ID Sales Amount ($) Status (Within ±2 SD)
TXN-01120Keep
TXN-02140Keep
TXN-03110Keep
TXN-0410,000 (Typo Outlier)Exclude
TXN-05130Keep
TXN-0695Keep
TXN-07105Keep
TXN-08115Keep
TXN-09125Keep
TXN-10110Keep

If we run our calculations on this sample data:

  • Raw Average: $1,105.00
  • Standard Deviation: $3,125.43
  • Lower Limit (-2 SD): -$5,145.86
  • Upper Limit (+2 SD): $7,355.86

Since the $10,000 transaction exceeds $7,355.86, it is classified as an outlier and dropped. The resulting outlier-excluded average is $116.67, which is a far more accurate representation of typical daily sales than $1,105.00.

---

Important Considerations When Using Standard Deviation for Outliers

1. Sample vs. Population Standard Deviation

Excel offers two main standard deviation formulas:

  • STDEV.S: Use this when your data represents a sample of your total sales (e.g., pulling a month's worth of transactions to represent overall trends). This is almost always the correct option for business reporting.
  • STDEV.P: Use this only when you have the entire population of data (e.g., every single transaction your company has ever processed in its history).

2. Handling Zeros and Blank Cells

By default, functions like AVERAGE and STDEV.S ignore blank cells, but they do count zero values. If your sales database contains rows with $0.00 representing canceled or failed transactions, these zeros will artificially lower your calculated average and warp your standard deviation. To fix this, you can filter out zeros beforehand inside your LET function:

sales_range, FILTER(B2:B1001, B2:B1001 > 0)

3. The Sensitivity Factor

While ±2 standard deviations is the standard threshold, you can adjust this multiplier depending on how strict you want to be. If you want to be highly sensitive and remove even minor anomalies, change the multiplier to 1.5. If you only want to filter out extreme, glaring errors, widen the range by using 3.

---

Conclusion

Relying on raw averages can lead to flawed insights and bad forecasting. By leveraging standard deviation inside Excel's conditional logic functions, you can build a self-cleaning spreadsheet that automatically strips away the noise of extreme outliers. Whether you choose the streamlined modern LET and FILTER formulas or the classic AVERAGEIFS approach with helper cells, you will gain a far cleaner, more reliable perspective on your business metrics.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.