Use the QUARTILE function to divide your data into four equal groups
Excel has a built-in function called QUARTILE that finds the values that split your dataset into quarters. You give it your data range and a number from 0 to 4, and it returns the cutoff point for that quarter. Quartile 1 is the 25th percentile, Quartile 2 is the median (50th percentile), and Quartile 3 is the 75th percentile.
The basic syntax is =QUARTILE(array, quart), where array is your data range and quart is the quartile number you want. If you have sales numbers in cells A2 through A50, typing =QUARTILE(A2:A50, 1) tells you the value below which 25 percent of your sales fall.
Key Takeaways
- The QUARTILE function takes two inputs: your data range and a number from 0 to 4, where 1, 2, and 3 give you the three quartile boundaries.
- Quartile 1 shows the 25th percentile, Quartile 2 shows the median, and Quartile 3 shows the 75th percentile of your data.
- You can calculate all four quartiles in separate cells and then use them to sort or filter your data into groups.
- Excel also offers QUARTILE.INC and QUARTILE.EXC as alternatives that handle edge cases slightly differently, though QUARTILE works for most everyday use.
The four quartile numbers and what they mean
When you use the QUARTILE function, the number you enter (0 through 4) determines which boundary you get back. Quartile 0 returns your minimum value, and Quartile 4 returns your maximum value. The three in-between quartiles are what most people mean when they talk about "finding quartiles."
Quartile 1 (the 25th percentile) is the value where one-quarter of your data falls below it. Quartile 2 is the median—half your data is below it, half above. Quartile 3 (the 75th percentile) is where three-quarters of your data falls below it. If you have 100 test scores, Quartile 1 tells you the score that separates the bottom 25 students from the rest.
Setting up your quartile calculations in a worksheet
Create a small reference table to the side of your data where you calculate all four quartiles at once. In column E, for example, type labels: "Min", "Q1", "Q2", "Q3", "Max" in cells E1 through E5. In column F next to each label, enter the corresponding QUARTILE formula.
In cell F1, type =QUARTILE(A2:A50, 0) for the minimum. In F2, type =QUARTILE(A2:A50, 1) for the first quartile. Continue with 2, 3, and 4 in cells F3, F4, and F5. Now you have all five boundary values in one place, and you can reference them elsewhere in your sheet without retyping the formula.
Using quartiles to categorize your data
Once you know your quartile values, you can use them to sort data into groups. If your Q1 value is 45 and your Q3 value is 78, you now know that any value below 45 is in the bottom quarter, values between 45 and 78 are in the middle half, and values above 78 are in the top quarter.
You can create a new column with an IF statement to assign each row to its quartile group. In column B, type =IF(A2<$F$2, "Q1", IF(A2<$F$4, "Q2-Q3", "Q4")) (using absolute references to your quartile cells with the $ signs). Copy this formula down your entire dataset, and each row will be labeled with its quartile group. This is useful for comparing performance, identifying outliers, or splitting a customer list into tiers.
QUARTILE.INC versus QUARTILE.EXC for edge cases
Excel offers two variants of the QUARTILE function: QUARTILE.INC (inclusive) and QUARTILE.EXC (exclusive). The plain QUARTILE function is the same as QUARTILE.INC. The difference matters only when you have very small datasets or when you need to match a specific statistical method.
QUARTILE.INC includes the minimum and maximum values in its calculation, while QUARTILE.EXC excludes them. For most everyday use—sales data, test scores, survey responses—QUARTILE.INC (the default) is what you want. If you are following a specific statistical standard or working with a very small sample, check whether your method calls for .INC or .EXC.
Common mistakes when calculating quartiles
The most common error is forgetting to lock your data range with dollar signs when you copy a formula down. If you type =QUARTILE(A2:A50, 1) and copy it to another cell, the range shifts to A3:A51, A4:A52, and so on. Use =QUARTILE($A$2:$A$50, 1) instead so the range stays fixed no matter where you paste.
Another mistake is including headers or text in your data range. If row 1 contains a label like "Sales" and you use A1:A50 instead of A2:A50, Excel will try to interpret the text as a number and may return an error. Always start your range at the first actual data cell, not the header.
A third pitfall is confusing quartiles with percentiles. Quartiles divide data into four parts, so they correspond to the 25th, 50th, and 75th percentiles. If you need a different percentile—say, the 90th—use the PERCENTILE function instead, which takes a decimal between 0 and 1 rather than a whole number.
Visualizing quartiles with a box plot
Once you have your quartile values, you can create a box plot (also called a box-and-whisker chart) to show them visually. A box plot displays your minimum, Q1, median, Q3, and maximum all at once, making it easy to spot where most of your data clusters and where outliers sit.
In Excel 2016 and later, you can insert a box plot directly: select your data, go to Insert, choose Charts, and look for the box-and-whisker option. Excel calculates the quartiles automatically. If you are using an older version, you can build a box plot manually using a scatter chart and error bars, though the built-in chart is much faster and clearer.
Frequently Asked Questions
What is the difference between QUARTILE and PERCENTILE?
QUARTILE divides data into four equal parts and takes a whole number from 0 to 4. PERCENTILE divides data into 100 equal parts and takes a decimal from 0 to 1. If you want the 75th percentile, you can use either QUARTILE(range, 3) or PERCENTILE(range, 0.75)—they give the same result.
Can I use QUARTILE on data in multiple columns?
QUARTILE works on a single range at a time. If you need quartiles for multiple columns separately, create a QUARTILE formula for each column. If you want to combine data from multiple columns into one quartile calculation, first copy all the values into a single column, then run QUARTILE on that combined range.
What does it mean if QUARTILE returns an error?
The most common cause is including text or headers in your data range. Make sure your range contains only numbers. Also check that you entered a quart value between 0 and 4. If you used a decimal like 1.5, Excel will round it or return an error depending on your version.
How do I find quartiles for grouped data or categories?
Use QUARTILE on each group separately. If you have sales by region, filter or copy the sales for Region A into its own range, then run QUARTILE on that range. Repeat for each region. Alternatively, use a helper column to label each row by region, then use QUARTILE with conditional logic or a pivot table to calculate quartiles per group.