To get the median of a set of numbers in Excel, click an empty cell and type =MEDIAN(A1:A10), replacing A1:A10 with the range that holds your numbers, then press Enter. The median is the middle value when the numbers are lined up in order, so it splits your data in half: one half is smaller, one half is larger. That makes it different from AVERAGE, which adds everything up and divides. If a single very large or very small number skews your average, the median usually tells a truer story about a typical value. Unlike MODE, which looks for repeats, and unlike AVERAGE, which is pulled by outliers, MEDIAN only cares about position in the sorted list.

What You'll Need

  • A spreadsheet with your numbers entered in cells, either in one column or one row, or spread across a table
  • Microsoft Excel (desktop on Windows or Mac, Excel for the web, or the mobile app). The MEDIAN function is the same across all of them, though the buttons and menus differ slightly by version
  • Numbers stored as actual numbers, not as text, for the formula to work

Step-by-Step

  1. Lay out your data so each number sits in its own cell. Do not type two numbers into one cell separated by a space or comma. Excel sees a single cell as one value, so "5, 8" is text, not two numbers. A clean column like A1 through A20 is the easiest layout to work with.
  2. Pick an empty cell for the answer. Put it somewhere outside your data range, such as C2 or a cell below the column, so the result does not get mixed into future range selections.
  3. Type the formula. Start with an equals sign, then the function name, then an open parenthesis: =MEDIAN(. Excel is not case-sensitive here, so =median( works just as well.
  4. Select or type your range. Drag across the cells, or type them directly. A range uses a colon: B2:B25, or a row range like B2:Z2. You can mix individual cells too, separated by commas: =MEDIAN(B2, B5, B9, B14). You can also type literal numbers: =MEDIAN(3, 7, 12, 12, 40).
  5. Close the parenthesis and press Enter. The full formula looks like =MEDIAN(B2:B25). The cell now shows the median, usually recalculated instantly whenever you change a number in the range.
  6. Check that the result makes sense. If you have an odd count of numbers, the median will be one of the actual values in your list. If you have an even count, the median is the average of the two middle values, so it can be a number that does not appear in your data at all. That is normal.
  7. Format the result if needed. If the median shows too many or too few decimals, select the cell and use the number format buttons on the Home tab, or right-click and choose Format Cells, to set the decimal places or add thousands separators.
  8. Copy the formula elsewhere if you want more than one median. Use the fill handle (the small square at the bottom-right corner of the selected cell) to drag the formula down or across. Relative references adjust automatically, so =MEDIAN(B2:B25) copied one column right becomes =MEDIAN(C2:C25). If you need the range to stay fixed, write it with dollar signs: =MEDIAN($B$2:$B$25).

Common Mistakes

  • Leaving blank cells inside the range. MEDIAN ignores empty cells, and that is usually fine. But if the blanks mean "zero" in your data, the formula will not count them, and the median will differ from what you intend. Fill zeros in explicitly if zero is a real measurement.
  • Mixing text into the range. Header labels, notes, or numbers stored as text are ignored by MEDIAN. The formula will not error out, which makes this easy to miss. Scan the range for stray labels or cells with a green triangle in the corner.
  • Confusing the median with the average. AVERAGE and MEDIAN often give different answers. On the list 1, 2, 3, 4, 100, the median is 3 and the average is 22. Pick the one that matches what you are actually asking about.
  • Forgetting that logical values can be counted. When you use typed arguments in the formula (like =MEDIAN(A1, TRUE, 5)), Excel can treat TRUE as 1 and FALSE as 0. Logical values inside a referenced range are ignored. Keep your data clean of accidental TRUE/FALSE entries to avoid confusion.
  • Typing the formula into a cell formatted as text. If the cell already contains text or starts with an apostrophe, Excel may show the formula as text instead of calculating it. Clear the cell, make sure the format is General or Number, and retype.
  • Selecting the wrong range after sorting or inserting rows. Inserting a row at the top of your data can push the range out of sync. Check the formula in the formula bar after structural edits.

Tips

  • Use MEDIAN together with AVERAGE on the same range to spot skew. A big gap between the two is a signal that outliers are present.
  • Press Ctrl+Shift+Enter only if you are using an older Excel version with array formulas; modern Excel handles =MEDIAN(IF(...)) style array formulas with plain Enter, so check your version if a formula behaves oddly.
  • For a median of numbers that meet a condition, use =MEDIAN(IF(range=criteria, values)). In current Excel this works with a normal Enter; older versions may need Ctrl+Shift+Enter. If you get an unexpected result, test it on a tiny sample first.
  • Name your data range (Formulas tab, Define Name) so the formula reads =MEDIAN(Scores). Named ranges are easier to audit and survive row insertions better than hard-coded addresses.
  • If you only want a quick look at the median, select the cells and check the status bar at the bottom of the window. It shows a running Average and Count by default and can be right-clicked to display Median.
  • Keep your raw data on one sheet and your formulas on another so sorting and filtering the source does not disturb your calculations.

Troubleshooting

  • The formula shows as text instead of a result. The cell is probably formatted as Text. Select it, set the format to General, and re-enter the formula. You can also check for a leading apostrophe in the formula bar.
  • You get #VALUE! or #NAME?. #NAME? usually means the function was misspelled or has a typo in the range, or a non-English version of Excel uses a translated name or a semicolon instead of a comma as the argument separator. #VALUE! often means the range includes cells Excel cannot interpret.
  • The result looks wrong. First, confirm the range is exactly what you think it is. Click the cell and look at the colored border that appears around the referenced range, or check the formula bar. Then check for hidden rows or filtered-out rows: MEDIAN counts hidden rows too, so a filtered view can give a different answer than the visible numbers suggest.
  • Numbers behaving as text. A number with a leading space, an apostrophe, or a label in the same cell will be skipped. Trim spaces with TRIM, or convert using Text to Columns or the VALUE function.
  • Mobile app acts differently. On the Excel mobile app, tap the cell, tap the formula bar, and type the function. Range selection is done by dragging the handles that appear. If a formula will not calculate, check the app is updated from the official store and that AutoCalculate is not turned off.
  • If that did not work, rebuild the formula step by step in a fresh cell: type =MEDIAN(, then click the first cell, hold Shift and click the last cell, type the closing parenthesis and press Enter. This avoids typos in typed ranges.

Frequently Asked Questions

Does MEDIAN sort my data?

No. The function works out the middle value internally without changing your sheet. Your data stays in the order you entered it.

What happens with an even number of values?

Excel averages the two middle numbers. So the median of 2, 4, 6, 8 is 5, even though 5 is not in the list.

Does MEDIAN ignore blank cells and text?

Yes. Blank cells, text and logical values inside a referenced range are skipped, so only numeric values are considered.

Can I take the median of numbers in more than one column?

Yes. Reference a block like A2:C20 and Excel treats every numeric cell in it as part of one list. Rows and columns both count.

What is the difference between MEDIAN and MEDIAN.M?

Excel does not have a MEDIAN.M function. MEDIAN already returns the median of a sample or population, so there is nothing more to add. It offers no option to include or exclude zero values automatically, so clean zeros yourself if you need to.

Can I get the median of only the visible rows after filtering?

Not directly with MEDIAN, because it counts hidden and filtered rows too. You would need an array formula or a helper column that flags visible rows, then build the median from that list.