What Quartiles Are and Why They Matter
A quartile is a value that divides a dataset into four equal parts. When you arrange numbers from smallest to largest, quartiles are the three points that split that line into quarters—each holding 25 percent of your data. The first quartile (Q1) marks where the lowest 25 percent ends, the second quartile (Q2) is the median or middle value, and the third quartile (Q3) marks where the lowest 75 percent ends.
Quartiles let you see how spread out your numbers are and where most of them cluster. If you're looking at test scores, salaries, or any measurement across a group, quartiles show you the range of the bottom quarter, the middle half, and the top quarter—without getting lost in every single number.
Key Takeaways
- Quartiles divide your data into four equal parts: arrange your numbers from smallest to largest, then find the three dividing points.
- The second quartile (Q2) is always the median—the middle value when your data is sorted.
- For Q1 and Q3, you find the median of the lower and upper halves of your data, using the same method you use for the overall median.
- Different calculation methods exist (inclusive and exclusive), and spreadsheet software may use different defaults, so check your tool's documentation.
- Once you have Q1, Q2, and Q3, you can calculate the interquartile range (IQR) by subtracting Q1 from Q3 to measure how tightly your middle 50 percent clusters.
Arrange Your Data from Smallest to Largest
Before you can find any quartile, sort your numbers in ascending order. This is the foundation of the entire process. If your data is already in a spreadsheet, use the sort function. If you're working by hand, write them out in order.
For example, if your dataset is: 15, 8, 22, 9, 31, 14, 27, you would arrange it as: 8, 9, 14, 15, 22, 27, 31. Now you have seven values in order, and you can find where the quartiles fall.
Find the Median (Second Quartile, Q2)
The median is the middle value when your data is sorted. This is your second quartile. If you have an odd number of values, the median is the one in the exact center. If you have an even number, the median is the average of the two middle values.
Using the example above with seven values (8, 9, 14, 15, 22, 27, 31), the median is 15—the fourth value, right in the middle. If you had eight values instead, you would average the fourth and fifth values.
Once you have Q2, you know the 50th percentile of your data. Half your values fall below it, and half fall above it.
Calculate Q1 (First Quartile)
Q1 is the median of the lower half of your data—everything below Q2. Take all the values that come before the median and find their middle point using the same method you used to find Q2.
In the example (8, 9, 14, 15, 22, 27, 31), the lower half is 8, 9, 14. The median of those three values is 9, so Q1 = 9. This means 25 percent of your data falls at or below 9.
If your lower half has an even number of values, average the two middle ones. For instance, if the lower half were 8, 9, 14, 16, the median would be (9 + 14) ÷ 2 = 11.5, making Q1 = 11.5.
Calculate Q3 (Third Quartile)
Q3 is the median of the upper half of your data—everything above Q2. Take all the values that come after the median and find their middle point.
In the example (8, 9, 14, 15, 22, 27, 31), the upper half is 22, 27, 31. The median of those three values is 27, so Q3 = 27. This means 75 percent of your data falls at or below 27.
Use the same averaging method for even-numbered upper halves as you did for Q1. The process is identical—you are straightforward working with the right side of your sorted data instead of the left.
Using Spreadsheet Software to Calculate Quartiles
Most spreadsheet programs have built-in functions that calculate quartiles automatically. In Microsoft Excel, use the QUARTILE function: type =QUARTILE(range, 1) for Q1, =QUARTILE(range, 2) for Q2, or =QUARTILE(range, 3) for Q3. Replace "range" with the cells holding your data, such as A1:A10.
Google Sheets uses the same syntax. LibreOffice Calc also supports QUARTILE. Some software offers QUARTILE.INC (inclusive method) and QUARTILE.EXC (exclusive method), which produce slightly different results on small datasets. For most practical purposes, the difference is negligible, but check your software's documentation if precision matters for your work.
Spreadsheet functions save time and reduce arithmetic errors, especially with large datasets. However, understanding the manual method helps you verify results and catch mistakes.
Calculate the Interquartile Range (IQR)
Once you have Q1 and Q3, you can find the interquartile range, or IQR. This is straightforward Q3 minus Q1. The IQR tells you how spread out the middle 50 percent of your data is.
In the example, Q1 = 9 and Q3 = 27, so IQR = 27 − 9 = 18. A smaller IQR means your middle values cluster tightly together. A larger IQR means they are more spread out. The IQR is also useful for identifying outliers—values that fall far outside the typical range.
Frequently Asked Questions
What's the difference between the inclusive and exclusive methods?
The inclusive method (QUARTILE.INC) includes the minimum and maximum values in the calculation, while the exclusive method (QUARTILE.EXC) excludes them. On datasets with 30 or more values, the difference is usually tiny. On small datasets, results can differ noticeably. Most general-purpose work uses the inclusive method.
Can I calculate quartiles if my data has duplicate values?
Yes. Treat duplicates as separate values when you sort. If your data is 5, 5, 8, 10, 10, 10, 15, sort it exactly as written and find the median of each section normally. Duplicates do not change the process.
What if my dataset has only a few values?
Quartiles work on any dataset with at least four values, though they are most meaningful with larger samples. With only four values, each quartile represents one value. With five to ten values, quartiles still work but may fall between two data points, requiring you to average them.
How do I know if a value is an outlier using quartiles?
Calculate the IQR, then multiply it by 1.5. Subtract this from Q1 to get the lower fence, and add it to Q3 to get the upper fence. Any value below the lower fence or above the upper fence is considered an outlier by this common rule.