Google Sheets Quartile Function: A Complete Guide
In this article
The Google Sheets QUARTILE function allows you to divide a dataset into four equal groups, identifying the values that mark the 25th, 50th, and 75th percentiles. This is primarily used to understand the spread of your data, identify outliers, and determine where the bulk of your values reside relative to the extremes. To use it, you simply need a range of numbers and a quartile number (0 through 4) to specify which marker you want to find.
What You'll Need
- A Google account with access to Google Sheets.
- A dataset consisting of numerical values (integers or decimals) organized in a column or row.
- Basic knowledge of how to select a cell range in a spreadsheet.
Step-by-Step
- Prepare Your Data: Ensure your numerical data is entered into a continuous range. For example, if you are tracking monthly sales, place all your sales figures in column A, from cell A2 to A100. Ensure there are no text strings or error messages within this range, as these can sometimes interfere with calculations depending on the function variation used.
- Select the Target Cell: Click on the empty cell where you want the result of the quartile calculation to appear. It is often helpful to create a small table to the side of your data with labels like "Minimum," "1st Quartile," "Median," "3rd Quartile," and "Maximum."
- Enter the Function Start: Type
=QUARTILE(into the cell. This tells Google Sheets that you are initiating the quartile calculation. - Define the Data Range: While the parenthesis is open, click and drag your mouse over the cells containing your data (e.g., A2:A100), or manually type the range. The formula should now look like
=QUARTILE(A2:A100,. - Specify the Quartile Number: After the comma, enter a number from 0 to 4 to determine which boundary you are seeking:
- 0: Returns the minimum value of the dataset.
- 1: Returns the first quartile (25th percentile). This is the middle value between the minimum and the median.
- 2: Returns the median value (50th percentile). This is the middle of the entire dataset.
- 3: Returns the third quartile (75th percentile). This is the middle value between the median and the maximum.
- 4: Returns the maximum value of the dataset.
- Close and Execute: Type the closing parenthesis
)and press Enter. For example, to find the 25th percentile of your sales data, the full formula would be=QUARTILE(A2:A100, 1). - Verify the Result: Check the resulting number against your data. If you are calculating the 1st quartile, the result should be a number where approximately 25% of your data points are lower and 75% are higher.
Common Mistakes
One of the most frequent errors is entering a quartile number outside the 0-4 range. If you enter 5 or -1, Google Sheets will return a #NUM! error because the function only recognizes the five specific markers of a four-part division. Another common mistake is including the header row in the range selection. If your range is A1:A100 and A1 contains the word "Sales," the function generally ignores the text, but it is best practice to select only the numerical data (A2:A100) to avoid unexpected behavior in more complex nested formulas.
Users also frequently confuse the QUARTILE function with the PERCENTILE function. While they achieve similar goals, QUARTILE is a simplified version designed specifically for the four standard quarters. If you need the 10th or 90th percentile, QUARTILE cannot do this; you must use the PERCENTILE function instead. Additionally, some users forget that the data does not need to be sorted in ascending order for the function to work. Google Sheets handles the sorting internally, so manually sorting your data first is an unnecessary step that can lead to errors if you accidentally overwrite a value during the sort process.
Tips
To make your analysis more dynamic, instead of typing the quartile number (0, 1, 2, 3, or 4) directly into the formula, reference a cell. For example, if you type the number "1" in cell C1, you can use the formula =QUARTILE(A2:A100, C1). This allows you to change the quartile you are viewing simply by changing the number in cell C1, rather than editing the formula itself every time.
If you are working with a very large dataset that contains empty cells or cells with non-numeric characters, consider using QUARTILE.INC or QUARTILE.EXC. The standard QUARTILE function is an "inclusive" calculation. QUARTILE.INC (Inclusive) includes the 0th and 4th quartiles, while QUARTILE.EXC (Exclusive) excludes them. The exclusive version is often preferred in advanced statistical analysis to avoid bias in small sample sizes, though it requires a larger dataset to function without returning an error.
Combine the QUARTILE function with a Box and Whisker plot. While Google Sheets does not have a native "Box Plot" chart type in the standard menu, you can use the results of your 0, 1, 2, 3, and 4 quartile calculations to manually build a representation of your data distribution. This visual aid makes it immediately obvious whether your data is skewed to the left or right.
Troubleshooting
If your formula returns a #NUM! error, first check the second argument of your function. Ensure the number is exactly 0, 1, 2, 3, or 4. If the number is correct, check if your data range contains any cells with errors (like #DIV/0! or #VALUE!). A single error within the range can cause the QUARTILE function to fail. To fix this, clean your data or use the IFERROR function to wrap your source data.
If the result seems mathematically incorrect, verify that your data is actually formatted as "Number." Sometimes, data imported from CSV files or other software is formatted as "Plain Text," even if it looks like a number. To fix this, select your data range, go to the Format menu > Number > Number. This ensures Google Sheets treats the values as digits rather than text strings.
If you are using QUARTILE.EXC and receiving a #NUM! error, it is likely because your dataset is too small. The exclusive function requires a minimum number of data points to calculate the boundaries without including the extremes. If this happens, switch back to the standard QUARTILE or QUARTILE.INC function, which works with smaller datasets.
Frequently Asked Questions
Does the QUARTILE function require the data to be sorted?
No, the data does not need to be sorted. Google Sheets automatically sorts the data internally to find the correct percentile markers regardless of the order of your cells.
What is the difference between QUARTILE and MEDIAN?
The MEDIAN function only finds the 50th percentile. The QUARTILE function can find the median (by using the number 2), but it can also find the 25th and 75th percentiles, as well as the minimum and maximum.
Can I use QUARTILE on data across different sheets?
Yes. You can reference another sheet by including the sheet name followed by an exclamation point. For example: =QUARTILE('Sheet2'!A2:A100, 1).
What happens if there are duplicate numbers in my dataset?
The function handles duplicates normally. If a large portion of your data consists of the same number, the 1st, 2nd, and 3rd quartiles may end up being the same value.
Can I use this function for dates?
Yes, because Google Sheets stores dates as numerical values behind the scenes, you can use the QUARTILE function to find the date that marks the 25th or 75th percentile of a time-based list.
Why does my result show as a decimal when I expected a whole number?
Quartiles often fall between two actual data points. In these cases, Google Sheets interpolates (calculates the average) between the two closest values, which often results in a decimal.