Finding IQR in Excel using the QUARTILE function
The interquartile range (IQR) measures the spread of the middle 50% of your data. In Excel, you calculate it by finding the difference between the third quartile (Q3) and the first quartile (Q1). The fastest way is to use the QUARTILE function twice in separate cells, then subtract one result from the other.
Here's the concrete approach: put your data in a column — say cells A2 through A50. In an empty cell, type =QUARTILE(A2:A50,3)-QUARTILE(A2:A50,1). Press Enter. That single formula gives you the IQR directly. The number 3 tells QUARTILE to find Q3 (the 75th percentile), and the number 1 tells it to find Q1 (the 25th percentile).
If you want to see Q1 and Q3 separately — which helps you understand what the IQR actually represents — put them in their own cells first. Type =QUARTILE(A2:A50,1) in one cell for Q1, and =QUARTILE(A2:A50,3) in another for Q3. Then subtract Q1 from Q3 in a third cell. This three-cell approach takes a few seconds longer but makes your calculation transparent to anyone reading your spreadsheet.
Key Takeaways
- IQR is calculated as Q3 minus Q1, where Q3 is the 75th percentile and Q1 is the 25th percentile of your data.
- Use the QUARTILE function with the syntax =QUARTILE(range,1) for Q1 and =QUARTILE(range,3) for Q3.
- You can calculate IQR in a single formula by typing =QUARTILE(range,3)-QUARTILE(range,1) in one cell.
- The QUARTILE function works with any continuous range of numbers, including negative values and decimals.
Using QUARTILE.INC and QUARTILE.EXC for different calculation methods
Excel offers two versions of the quartile function: QUARTILE.INC and QUARTILE.EXC. The difference lies in how they handle the boundaries of your data. QUARTILE.INC (inclusive) includes the minimum and maximum values in its calculation, while QUARTILE.EXC (exclusive) excludes them.
For most everyday analysis, QUARTILE.INC is the standard choice and produces the same result as the plain QUARTILE function. Use QUARTILE.EXC only if you're following a specific statistical method that requires it — your instructor or colleague would tell you if that's the case.
To use them, replace QUARTILE with either function name: =QUARTILE.INC(A2:A50,3)-QUARTILE.INC(A2:A50,1) or =QUARTILE.EXC(A2:A50,3)-QUARTILE.EXC(A2:A50,1). The rest of the formula stays the same. Both versions will give you a numeric result; the difference is usually small unless your dataset is very small.
Handling empty cells and text values in your data
QUARTILE ignores empty cells automatically, so you don't need to clean those out. If your range includes text values or cells with errors, QUARTILE will skip those too and calculate based only on the numeric values it finds.
If your data has a header row — like "Sales" in cell A1 and numbers starting in A2 — make sure your range starts at A2, not A1. Including the text header will cause Excel to ignore it, but it's clearer to exclude it from the start. For a dataset that spans A2 to A500, use =QUARTILE(A2:A500,3)-QUARTILE(A2:A500,1).
Visualizing quartiles with a box plot
Once you've calculated Q1, Q3, and the IQR, you can create a box plot to see the distribution visually. A box plot shows Q1 and Q3 as the edges of a box, with a line inside marking the median (Q2). This makes it easy to spot outliers and see whether your data is skewed.
To create a box plot in Excel, select your data range, go to the Insert tab, click Charts, and look for the Box and Whisker chart type. Excel will calculate the quartiles for you automatically and draw the plot. You can then add titles and labels to make it clear what you're showing. The box plot gives you a visual confirmation of the IQR you calculated with the formula.
Common mistakes when calculating IQR
The most frequent error is using AVERAGE or MEDIAN instead of QUARTILE. Those functions find the center of the data, not the quartiles. Another mistake is forgetting to subtract Q1 from Q3 — if you only calculate Q3, you're missing half the picture.
A third pitfall is including extra rows or columns in your range by accident. If you type =QUARTILE(A:A,3) to include the entire column A, Excel will process every cell in that column, including any stray numbers you may have entered elsewhere. It's safer to specify the exact range: =QUARTILE(A2:A50,3).
Finally, don't confuse IQR with range. Range is the difference between the maximum and minimum values (the full spread), while IQR is the spread of only the middle 50%. They answer different questions about your data and are both useful in different contexts.
Frequently Asked Questions
What does IQR tell me about my data?
IQR shows how tightly clustered the middle half of your data is. A small IQR means the middle values are close together; a large IQR means they're spread out. It's useful for spotting outliers — values that fall far outside the IQR are often considered unusual or worth investigating.
Can I calculate IQR for data in multiple columns?
Yes, but you calculate the IQR for each column separately. Use =QUARTILE(B2:B50,3)-QUARTILE(B2:B50,1) for column B, =QUARTILE(C2:C50,3)-QUARTILE(C2:C50,1) for column C, and so on. You cannot calculate a single IQR across multiple columns unless you're treating them as one continuous dataset.
What if my data includes negative numbers?
QUARTILE handles negative numbers without any problem. The function treats them like any other numeric value and calculates Q1 and Q3 normally. Your IQR result may be negative if Q1 is negative and larger in absolute value than Q3, though this is rare in practice.
Is there a difference between IQR and the interquartile range?
No — IQR is short for interquartile range. They mean the same thing: the distance between the first and third quartiles.