To calculate the interquartile range (IQR) in Excel, put your data in one column and use =QUARTILE.INC(range,3)-QUARTILE.INC(range,1). That single formula returns Q3 minus Q1, which is the IQR: the spread of the middle 50% of your values. If you need a step-by-step walkthrough with Q1, Q3, the IQR itself and outlier fences, the numbered steps below cover it.

The IQR matters because it ignores the extreme tails of your data. If you are tracking daily electricity use, sensor temperature readings or how long a device stays online, a couple of odd days can drag an average down while the IQR stays stable. Excel has two quartile families: QUARTILE.INC (inclusive, matching the common-percentile method) and QUARTILE.EXC (exclusive). For a general IQR, use QUARTILE.INC. The older QUARTILE function still works and returns the same result as QUARTILE.INC, but it is kept only for backward compatibility.

What You'll Need

  • Excel for Microsoft 365, Excel 2019 or later, Excel for Mac, or Excel for the web. Older versions may lack QUARTILE.INC; use QUARTILE there instead.
  • Your data in a single column or row with one numeric value per cell, with a header row above it (optional but recommended).
  • Empty cells nearby to hold Q1, Q3 and the IQR result.
  • Data with at least four numeric values. Quartiles become meaningless below about four points.

Step-by-Step

  1. Lay out the data. Put your numbers in a single column, for example A2:A101. Keep the column clean: no merged cells, no text like "n/a" mixed in, no blank rows in the middle. Text entries are ignored by the quartile functions, but blanks split the range if you select only part of it.
  2. Name the range. Click cell A1 and press Ctrl+Shift+End (Windows) or select the data yourself. To make formulas readable, select the data, click the Name Box left of the formula bar, type Data and press Enter. Every formula below can then use Data instead of A2:A101.
  3. Check for numbers stored as text. Select the data column, then look at the status bar at the bottom of the window. If it shows no Sum, Average or Count of numbers, some values are text. Use Data > Text to Columns and click Finish, or multiply the column by 1 in a helper column, to convert them. Quartile functions skip text silently, so an unnoticed text value quietly shrinks your sample.
  4. Calculate Q1. In an empty cell, type =QUARTILE.INC(Data,1) and press Enter. Excel returns the first quartile, the 25th percentile.
  5. Calculate Q3. In the next cell, type =QUARTILE.INC(Data,3) and press Enter. This is the 75th percentile.
  6. Subtract to get the IQR. In a third cell, type =QUARTILE.INC(Data,3)-QUARTILE.INC(Data,1). This is the headline number, the width of the middle half of your data.
  7. Alternatively, use cells. If Q1 is in C2 and Q3 is in C3, type =C3-C2 in C4. This makes the arithmetic visible and easier to check than a single nested formula.
  8. Build the outlier fences. The standard rule flags values below Q1 minus 1.5×IQR and above Q3 plus 1.5×IQR. With the IQR in C4, type =C2-1.5*C4 for the lower fence and =C3+1.5*C4 for the upper fence.
  9. Flag outliers (optional). In a helper column next to your data, in row 2, type =IF(OR(A2<$C$5,A2>$C$6),"Outlier",""), assuming C5 holds the lower fence and C6 the upper fence. Drag the fill handle down to the last row. The dollar signs matter: they lock the fence references so they do not shift as you copy.
  10. Verify one value by hand. Use =MEDIAN(Data) to check the median sits between Q1 and Q3. If it does not, you likely have text values, a stray blank or a range that includes a header.

Label the Q1, Q3 and IQR cells clearly, for example "Q1", "Q3" and "IQR (Q3-Q1)". A bare number with no label is easy to misinterpret six months later, especially if someone assumes it is a standard deviation.

Common Mistakes

  • Mixing the inclusive and exclusive functions. QUARTILE.EXC returns different results and can even throw an error for small samples. Pick one family and use it for every cell. Mixing them across sheets gives figures that will not reconcile.
  • Including the header row. If A1 contains "Date" and you select A1:A101, that text is ignored, so the numbers are usually fine, but any header that looks numeric (a year, for instance) gets counted as data.
  • Ranges that stop short. Typing A2:A90 when your data runs to A101 halves the sample. Use the Name Box or Ctrl+Shift+Down to check the true last row.
  • Forgetting the relative-reference problem. If you write =IF(OR(A2<C5,A2>C6),...) and copy it down, C5 and C6 move with the formula and the flags become meaningless. Use absolute references.
  • Confusing IQR with standard deviation. IQR is a range in the same units as your data. Standard deviation measures average spread around the mean. Both are useful; they answer different questions.
  • Flagging outliers automatically as errors. An outlier is a data point that deserves a look, not proof of a mistake. Sensor spikes and genuine anomalies are both possible, so inspect the record before deleting anything.

Tips

  • Use =QUARTILE.INC(Data,0) and =QUARTILE.INC(Data,4) for the minimum and maximum, and the second argument accepts a whole set at once if you build a small summary table.
  • For a whole table at once, =QUARTILE.INC(Data,{1,3}) entered across two cells spills Q1 and Q3 side by side in newer Excel versions.
  • Turn the data into a box plot with Insert > Insert Statistic Chart > Box and Whisker to see the IQR and the outliers visually. Box plots use quartiles, so the chart and your formulas should agree.
  • Keep raw data on one sheet and calculations on another. If the source changes, the formulas update automatically, but only if the range is intact.
  • Document which method you used in a note on the sheet, because QUARTILE.INC and QUARTILE.EXC give different answers and a reviewer will ask.

Troubleshooting

  • #NUM! error. QUARTILE.EXC returns this for very small samples. Switch to QUARTILE.INC or add more data points.
  • #VALUE! error. A referenced cell is text or an error value. Select the data and check the status bar counts, then clean the range.
  • #NAME? error. The function name is mistyped, or you are on a version that does not have QUARTILE.INC. Use QUARTILE instead, which behaves the same.
  • Result looks too small or too large. Confirm Q1 is below the median and Q3 above it using =MEDIAN(Data). If not, the range or the argument order is wrong.
  • Formulas do not update when you add rows. Convert the range to an Excel Table with Ctrl+T, then reference the table column name. Tables expand automatically as rows are added, so the formula keeps working.
  • If that did not work, rebuild the calculation from scratch in a clean sheet: paste values only into column A, add the two quartile formulas, subtract them, and compare the number with the original. This isolates whether the issue is the data or the formula.

Frequently Asked Questions

Does the IQR formula exist as a single Excel function?

No. Excel has no dedicated IQR function, so you subtract Q1 from Q3 with two QUARTILE.INC calls or reference cells holding them.

Should I use QUARTILE.INC or QUARTILE.EXC?

Use QUARTILE.INC for general analysis because it matches the widely used inclusive percentile method and works with small samples. Use QUARTILE.EXC only when a method or standard you are following specifies it.

How many values do I need for a meaningful IQR?

At least four, and more for a stable figure. Small samples are sensitive to each value, so treat the result with caution when the count is low.

Why are some data points ignored in my range?

The quartile functions skip text, logical values and empty cells. If numbers appear missing, they are probably stored as text and need converting.

Can I use the IQR to find outliers?

Yes. Values below Q1 minus 1.5×IQR or above Q3 plus 1.5×IQR are commonly treated as outliers. The 1.5 multiplier is a convention, not a law; a stricter or looser multiplier is a defensible choice if you say which one you used.