Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Median of Selected Numbers.

Median of Selected Numbers

Written by Allen Wyatt (last updated December 2, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


1

William is trying to find the median of about 3,000 numbers in a column that has a range from 0.9 to 5. However, he only wants the median of numbers that are greater than 1. He can't figure out how to put that parameter into his formula and is looking for ideas.

Short of creating a user-defined function in a macro, there are a couple of ways you can go about determining the median. One method is to use an intermediate column that contains only those values above 1 and then calculate the median based on those values. You could also use an advanced filter to extract only the values above 1 and then use those values to find the median.

A better approach, however, is to use a simple array formula:

=MEDIAN(IF($A$1:$A$3000>1,A1:A3000))

In earlier versions of Excel you'll need to enter this as an array formula by using Ctrl+Shift+Enter. (In Microsoft 365 or Excel 2021 you can just press Enter.) The result is your median value, with your criteria taken into account.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7922) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Median of Selected Numbers.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using FIM Barcodes

Adding a Facing Identification Mark (FIM) barcode to your envelopes.

Discover More

Creating an Index Entry for a Range of Pages

Putting together an index for your documents can be challenging, but Word provides some great tools to make the task ...

Discover More

Headings in Tables Not Showing in TOC

Word includes a couple of built-in tools that rely upon the use of heading styles in your document. These tools include ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Checking for Text

Need to figure out if a particular cell contains text? You can use the ISTEXT function to easily return this bit of trivia.

Discover More

Finding the Date Associated with a Negative Value

When working with data taken from the real world, you often have to determine which certain conditions were met, such as ...

Discover More

Counting with Formulas

When you need to count a number of cells based upon a single criteria, the standard function to use is COUNTIF. This tip ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 5?

2023-12-03 10:57:08

J. Woolley

The Tip's formula works because MEDIAN ignores text, logical values, or empty cells in an array or reference argument; therefore, FALSE values in the formula's array argument are not interpreted as zero values. Notice this formula would produce a different result because FALSE is replaced by zero:
    =MEDIAN(IF($A$1:$A$3000>1,A1:A3000,0))
(It should also be noted that logical values and text representations of numbers typed directly into MEDIAN's list of arguments are NOT ignored.)
The Tip says, "In earlier versions of Excel you'll need to enter this as an array formula by using Ctrl+Shift+Enter." I don't think this is necessary because the formula does not return an array.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.