Function Problems

How to Calculate the Median of Positive Values Only in Excel

Tauseeq MagsiTauseeq Magsi Nov 10, 2026 869 views

Question details

The user needs to calculate the median of a dataset while explicitly ignoring zero and negative amounts in a fixed range.

How to Calculate the Median of Only Positive Values in Excel
Product
Excel
Device & OS
not provided
Scenario
Calculating statistical median values strictly for positive numbers within a dataset without needing to manually adjust the data range.
Observed behavior
The user requires a dynamic formula that evaluates a fixed range and automatically excludes non-positive values from the median calculation.
Before you start

Identify the range of cells containing your data (e.g., A1:A10) and ensure your numerical data does not contain text formatted to look like numbers, as this can cause formula errors.

Solution 1Recommended

Use the MEDIAN and FILTER Functions (Excel 365 and 2021+)

The most efficient method for newer Excel versions is combining MEDIAN with the dynamic FILTER function to easily exclude zeros and negatives.

The FILTER function automatically creates a dynamic array of values that meet your specific criteria (in this case, numbers greater than zero). The MEDIAN function then processes only this filtered array.

1
Select the destination cell

Click on the empty cell where you want the median result to appear.

2
Enter the MEDIAN and FILTER formula

Type the formula =MEDIAN(FILTER(A1:A10, A1:A10>0)), replacing A1:A10 with your actual data range.

3
Calculate the result

Press Enter to calculate the median of only the positive values.

Use the MEDIAN and FILTER Functions (Excel 365 and 2021+)
Handling Empty Results: If there is a chance your range contains no positive values, wrap the formula in an IFERROR statement to prevent #CALC! errors, such as: =IFERROR(MEDIAN(FILTER(A1:A10, A1:A10>0)), "No positive values").
Free Spreadsheet Software

Calculate Medians Easily in WPS Spreadsheet

WPS Spreadsheet is a powerful, free tool that supports advanced dynamic array formulas, including MEDIAN and FILTER, exactly like Microsoft Excel. You can seamlessly calculate complex statistics and handle large datasets securely without paying for a subscription.

  1. 1. Open your data file: Launch WPS Spreadsheet and open your existing Excel workbook (.xlsx).
  2. 2. Enter the formula: Select a blank cell and input the dynamic formula: =MEDIAN(FILTER(A1:A10, A1:A10>0)).
  3. 3. Get your result: Press Enter to instantly view the calculated median of your positive values.
Fully compatible with Microsoft Excel formulas and .xlsx file formats.Supports advanced dynamic functions like MEDIAN, FILTER, and IF arrays natively.Lightweight, fast-loading, and runs smoothly on both new and older devices.Free to use with a familiar, easy-to-navigate user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my array formula returning an error in older Excel versions?

In older versions of Excel, functions combined with IF to process ranges must be explicitly entered as array formulas. You need to press Ctrl + Shift + Enter instead of just Enter. If done correctly, curly braces {} will appear around the formula in the formula bar.

Can I ignore both zeros and blank cells when calculating the median?

Yes, the condition >0 in both the FILTER and IF methods automatically ignores completely blank cells and cells containing exactly zero, ensuring only positive numbers are included in the median calculation.

How do I calculate the median of negative values only?

To find the median of strictly negative numbers, change the logical operator in your formula to less than zero. For example, use =MEDIAN(FILTER(A1:A10, A1:A10<0)) or the Ctrl+Shift+Enter equivalent =MEDIAN(IF(A1:A10<0, A1:A10)).