Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Find the Median in Excel: Step-by-Step

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The fastest way to compute the median in Excel is to type =MEDIAN(range) into an empty cell, replacing range with the cells that hold your numbers, and press Enter. For example, =MEDIAN(A2:A100) returns the middle value of that column. Excel selects the middle value after sorting the numbers internally, so you never have to sort your data yourself and the original order of your list does not change. The function works in Excel for Microsoft 365, Excel 2021 and 2024, Excel 2019, Excel 2016, Excel for Mac, Excel for the web, and the mobile Excel apps, and the result auto-updates whenever the underlying numbers change.

What You'll Need

  • A worksheet containing a column or row of numeric values, ideally with a header row so you know what the data means.
  • An empty cell to hold the result, usually just to the side or beneath your data.
  • Numbers stored as real numbers, not text. Numbers typed manually or imported as clean numeric values work; values pasted from the web with extra spaces or invisible characters may not.

Step-by-Step

  1. Identify your data range. Look at the column you want to analyse and note the first and last cell, for instance A2 through A50. You can also click the first cell and drag to the last cell; Excel then inserts the range reference into the formula for you, which avoids typos. This guide uses a vertical column as the example, but the same steps work for a horizontal row.
  2. Click an empty cell where you want the answer to appear. A cell directly below the data range or beside it is easiest to read later.
  3. Type the formula. Begin with an equals sign, then the function name in capitals (capitalisation is optional but keeps formulas readable): =MEDIAN(. Excel shows a tooltip listing the arguments it expects, which confirms you are on the right function.
  4. Select or type the range. Drag over the data cells, or type the range reference, then close the parenthesis so the formula reads =MEDIAN(A2:A50).
  5. Press Enter. The cell shows the median and, if you click it, the formula stays visible in the formula bar at the top of the window. Format the result as a number or currency to match the rest of your sheet if you like; the median inherits no formatting from the source cells.
  6. Verify the result with a quick sanity check. Compare the median with the average using =AVERAGE(A2:A50). If the two are far apart, your data is skewed or contains outliers, and that is often the reason you wanted a median in the first place. If the median sits outside the smallest and largest values, something in the range is wrong.
  7. Use the Function Wizard if you prefer clicking. Click the Insert Function button (the fx symbol beside the formula bar or on the Formulas ribbon), type median in the search box, choose MEDIAN, then use the Number1 box to select the range. Click OK. This is a good fallback when you cannot remember the syntax.

Note that menu names, ribbon labels and dialog wording can differ slightly between Excel versions, between Windows and Mac, and between regional builds, but the function name and formula syntax are the same everywhere. On iPhone, iPad and Android, the same formula can be typed into the formula bar or entered through the Insert Function option in the mobile app's editing area; the layout is more compact, so selecting a long range is easier to do by typing the range reference rather than dragging.

Common Mistakes

  • Including the header cell in the range. Text values are ignored by MEDIAN, so a header will not usually break the result, but it clutters the range and is a frequent source of confusion. Start the range at the first data cell, not the title row.
  • Numbers stored as text. If values were imported or pasted with their formatting, Excel may treat them as text and silently ignore them, giving a wrong or inflated answer. A single #NUM! error appears when none of the referenced cells can be read as numbers.
  • Confusing median with average. The median is the middle value and is unaffected by a few extreme values; the average is the sum divided by the count. For salaries, house prices or response times, they can differ a lot.
  • Forgetting blank cells are skipped. Empty cells are ignored, so the median is calculated only from the cells that actually contain numbers. That is usually what you want, but it means a partly filled column can report a median from fewer rows than you expect.
  • Typing the function name wrong. =MEDIAN is the only official spelling; misspellings such as MEDAIN produce the #NAME? error.
  • Expecting MEDIAN to work like MEDIANA on SharePoint. There is a separate function called MEDIANA that runs only on SharePoint lists, not in Excel worksheets. Use MEDIAN in Excel.

Tips

  • Use a whole-column reference like =MEDIAN(A:A) when you plan to add rows over time. It references every cell in the column, so new entries are included automatically, but it will also pick up any stray numbers elsewhere in that column.
  • To find the median of several separate blocks, list each range as a separate argument: =MEDIAN(A2:A20, C2:C20). Commas separate arguments in most locales; some regional formats use semicolons instead of commas as the argument separator.
  • Wrap a range in IF or FILTER to find the median of a subset, for example the median of sales in one region only. With modern Excel, typing the formula and pressing Ctrl+Shift+Enter on older versions may be needed; newer versions handle it as a dynamic array automatically.
  • To turn the value into usable text, combine the formula with a formatting function using the & operator, such as showing the median beside a label. The number itself stays numeric inside the cell.
  • Keep a header row and apply a table format: Excel's table feature lets the formula refer to the table column by name, like =MEDIAN(Sales[Amount]), which survives row insertions and is easier to audit later.
  • If you need the median across more than one worksheet, use cross-sheet references, for example =MEDIAN(Sheet1!A2:A50).

Troubleshooting

If you get #NAME?, the function is misspelled or the equals sign is missing. Recheck the formula text and type it again cleanly rather than editing inside the cell. If you get #NUM!, Excel found no numeric values in the range: select the data and confirm that cells are not formatted as text and do not contain stray apostrophes or spaces, which often arrive with pasted data. A quick test is to enter =ISNUMBER(A2) beside a suspicious cell; FALSE means Excel is reading the value as text. To fix, replace the apostrophes or re-enter the number manually, or format the cells as Number and retype.

If you get #REF!, the range reference points to a deleted row or column or to another sheet that no longer exists, so rebuild the range. If the answer seems too low or too high, check for hidden rows inside the range, numbers imported with thousands separators, and non-numeric entries that Excel ignores or, in the case of error values, that return an error rather than a median. A range containing an error value like #DIV/0! makes MEDIAN return that same error, so find and clear the bad cell first.

If the formula result does not update after you change a number, check that workbook calculation is not set to Manual: on the Formulas ribbon, the Calculation Options group controls this. Set it back to Automatic. If the cell shows the formula text instead of the result, the cell is formatted as Text; change the format to General and re-enter the formula.

If that did not work, copy the range into a fresh sheet without formatting, use Paste Special with Values, and run MEDIAN there. This isolates whether the problem is the data or the workbook. For workbooks shared with others, also check whether the MEDIAN cell sits inside a locked range or protected sheet, which can block recalculating formulas.

Frequently Asked Questions

What is the difference between median and average in Excel?

The average (AVERAGE) adds every value and divides by the count, so one very large value pulls it up. The median (MEDIAN) is the middle value after sorting and stays stable when a few extreme values appear, which is why it is often preferred for skewed data.

Does MEDIAN include zeros and negative numbers?

Yes. Zeros and negative values are real numbers and are counted normally, so they affect the position of the middle value. Blank cells, text and logical values such as TRUE and FALSE are ignored.

What happens with an even number of values?

With an even count there is no single middle value, so Excel returns the average of the two middle numbers. For example, the median of 1, 2, 3, 4 is 2.5.

Can I use MEDIAN on filtered data?

MEDIAN ignores rows you have hidden by filtering only if those rows are outside the range or the function does not receive them explicitly. To get the median of visible rows only, use SUBTOTAL with a median-equivalent approach or a helper formula; plain MEDIAN will include every row in the range, hidden or not.

Does the median update automatically?

Yes, as long as calculation is set to Automatic, which is the default. Change a number in the range and the cell updates immediately without re-entering the formula.