Excel has a built-in function that calculates quartiles in one step
The QUARTILE function in Excel finds the values that divide your data into four equal parts. Type =QUARTILE(range, quart), replace range with your data cells, and replace quart with a number from 0 to 4. The function returns the value at that quartile boundary.
For example, if your data is in cells A2 through A101, the formula =QUARTILE(A2:A101, 1) returns the first quartile — the value below which 25 percent of your data falls. Using 2 gives you the median, 3 gives you the third quartile, and 0 or 4 give you the minimum and maximum values.
Excel also offers QUARTILE.INC and QUARTILE.EXC, which calculate quartiles slightly differently depending on how you want to handle the edges of your dataset. QUARTILE.INC is the older standard and is what most people mean when they say "quartile." QUARTILE.EXC excludes the minimum and maximum from the calculation. For most purposes, QUARTILE and QUARTILE.INC produce identical results.
Key Takeaways
- The QUARTILE function takes two inputs: your data range and a number from 0 to 4 that tells Excel which quartile to return.
- QUARTILE(A2:A101, 1) returns the first quartile, the value below which 25 percent of your data sits.
- QUARTILE.INC and QUARTILE.EXC are newer versions that handle edge cases differently, but QUARTILE.INC matches the original QUARTILE function.
- You can place the QUARTILE formula in any empty cell and copy it down to calculate multiple quartiles at once.
How to enter the QUARTILE formula step by step
Click on an empty cell where you want the result to appear. Type the equals sign to start a formula. Then type QUARTILE(, click and drag to select the range of cells containing your data, type a comma, type the quartile number you want (1, 2, or 3), and close the parenthesis with ). Press Enter.
If your data is in column A from row 2 to row 101, and you want the first quartile, the complete formula looks like this: =QUARTILE(A2:A101,1). Excel calculates the result and displays it in that cell. To find all three quartiles, you can enter the same formula three times in different cells, changing only the final number each time.
The QUARTILE function ignores empty cells and text automatically, so you do not need to clean your data first. However, if a cell contains text that looks like a number — such as the number stored as text — Excel will skip that cell rather than treat it as a value.
Understanding what each quartile number means
The second input to QUARTILE tells Excel which boundary to return. The number 1 returns the first quartile (the 25th percentile), the number 2 returns the second quartile (the 50th percentile, also called the median), and the number 3 returns the third quartile (the 75th percentile). The numbers 0 and 4 return the minimum and maximum values in your range, which are sometimes called the zeroth and fourth quartiles.
In practice, most people use 1, 2, and 3. The first quartile is the cutoff below which one-quarter of your values fall. The second quartile is the middle value. The third quartile is the cutoff below which three-quarters of your values fall. Together, these three numbers divide your dataset into four groups of roughly equal size.
QUARTILE.INC versus QUARTILE.EXC and when the difference matters
Excel offers two versions of the quartile function because statisticians disagree on the exact method for calculating them. QUARTILE.INC (inclusive) includes the minimum and maximum values in the calculation, while QUARTILE.EXC (exclusive) excludes them. For most datasets, the difference is small enough that you will not notice it.
QUARTILE.INC is the default and matches what the original QUARTILE function does, so unless you have a specific reason to use QUARTILE.EXC, stick with QUARTILE or QUARTILE.INC. The difference becomes visible only with very small datasets or when your data has extreme outliers. If you are working with a dataset of 30 or more values, the two methods produce nearly identical results.
Finding quartiles without using a function
If you want to understand how Excel calculates quartiles, you can do it manually using the PERCENTILE function instead. The first quartile is the 25th percentile, the second is the 50th percentile, and the third is the 75th percentile. The formula =PERCENTILE(A2:A101, 0.25) returns the same result as =QUARTILE(A2:A101, 1).
This approach is useful if you need to find other percentiles — say, the 10th or 90th — because PERCENTILE works with any decimal between 0 and 1. However, for quartiles specifically, QUARTILE is simpler and faster to type. You can also sort your data and count manually to the 25th, 50th, and 75th percentile positions, but this method is slow and error-prone with large datasets.
Using quartiles to identify outliers and understand data spread
Quartiles help you see how spread out your data is and spot values that do not fit the pattern. The distance between the first and third quartiles is called the interquartile range, or IQR. A value is often considered an outlier if it falls below the first quartile minus 1.5 times the IQR, or above the third quartile plus 1.5 times the IQR.
For example, if your first quartile is 10, your third quartile is 20, then your IQR is 10. Values below 10 − (1.5 × 10) = −5 or above 20 + (1.5 × 10) = 35 might be outliers. You can use this method to flag suspicious data points or to understand whether your dataset has a few extreme values pulling the average in one direction.
Creating a box plot to visualize quartiles
Excel can draw a box plot (also called a box-and-whisker chart) that shows all four quartiles at once. Select your data, go to the Insert tab, click the chart icon, and choose Box and Whisker from the chart type list. Excel automatically calculates the quartiles and draws a box showing the first quartile, median, and third quartile, with whiskers extending to show the range.
A box plot is useful when you want to compare quartiles across multiple groups or see the full picture of your data distribution in one glance. The box itself represents the middle 50 percent of your data, the line inside the box is the median, and the whiskers show where the extreme values sit. This visual approach often makes patterns clearer than looking at numbers alone.
Frequently Asked Questions
What is the difference between QUARTILE and PERCENTILE in Excel?
QUARTILE divides data into four equal parts and takes a number from 0 to 4. PERCENTILE divides data into 100 equal parts and takes a decimal from 0 to 1. The first quartile equals the 25th percentile, the second quartile equals the 50th percentile, and the third quartile equals the 75th percentile. Use QUARTILE when you want quartiles specifically; use PERCENTILE when you need other percentiles.
Does QUARTILE work with negative numbers?
Yes, QUARTILE works with negative numbers, zero, and positive numbers all mixed together. It treats them as regular values and calculates the quartile boundaries based on their position in the sorted dataset. If your data ranges from −50 to 100, the quartile function will return values within that range.
What happens if I use QUARTILE on a range with only a few values?
QUARTILE still works, but the results may feel less meaningful. With only four values, each quartile boundary falls exactly on one of your data points. With ten values, the quartiles divide them into groups of roughly 2.5 each. For reliable quartile calculations, most statisticians recommend at least 20 to 30 data points, though the function will calculate a result regardless.
Can I use QUARTILE on a range that includes text or blank cells?
QUARTILE ignores blank cells and text automatically, so you can include them in your range without breaking the formula. The function counts only the numeric values. If a cell contains a number stored as text, Excel skips it, which may give you unexpected results if you did not realize some values were stored as text rather than numbers.
How do I calculate the interquartile range in Excel?
Subtract the first quartile from the third quartile. Use the formula =QUARTILE(A2:A101,3)-QUARTILE(A2:A101,1). This gives you the range that contains the middle 50 percent of your data. A larger interquartile range means your data is more spread out; a smaller one means the values cluster closer together.