You just learned a commonly used method to calculate the quartiles of a dataset. However, there is another method that is equally accepted that results in different values!

Note that there is no universally agreed upon method of calculating quartiles, and as a result, two different tools might report different results.

The second method includes Q2 when trying to calculate Q1 and Q3. Let’s take a look at an example:

[108,4,8,15,16,23,42][-108, 4, 8, 15, 16, 23, 42]

Using the first method, we found Q1 to be 4. When looking at all of the points below Q2, we excluded Q2. Using this second method, we include Q2 in each half.

For example, when calculating Q1 using this new method, we would now find the median of this dataset:

[108,4,8,15][-108, 4, 8, 15]

Using this method, Q1 is 6.



Create a variable named dataset_one_q1 and set it equal to the first quartile of dataset one. This time, use the second method of finding quartiles.


Create a variable named dataset_one_q3 and set it equal to the third quartile of dataset one. Again, use the second method of finding quartiles.


Create two variables named dataset_two_q1 and dataset_two_q3 and set them equal to the first and third quartile of dataset two.

Use the second method of calculating quartiles. Since Q2 fell between two data points, this method is no different than the first method!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?