
Dan Patiño
AI Strategy & Innovation at Coderhouse
Data
Percentiles tell you the value below which a given percentage of the data falls. The 90th percentile of delivery time, for example, is the time that 90% of deliveries beat. Quartiles are the three percentiles that split sorted data into four equal parts, and the interquartile range (IQR) is the distance between the first and third quartiles: the spread of the middle 50% of your data.
They matter because averages hide a lot. Two products can share the same average response time while one leaves a tenth of its users waiting far longer. Percentiles show what typical, slow and extreme cases look like, which is why data analysts use them for salaries, performance metrics, customer behavior and outlier detection.
Percentiles, quartiles and the IQR at a glance
Q1 (25th percentile): 25% of values are at or below it.
Q2 (50th percentile): the median; half the values are below it.
Q3 (75th percentile): 75% of values are at or below it.
IQR = Q3 − Q1: the range covered by the middle half of the data.
The NIST/SEMATECH e-Handbook of Statistical Methods explains how percentiles are estimated from samples, and Khan Academy's IQR review has extra practice problems.
How to calculate quartiles and the IQR
Take the order values (in dollars) from eleven customers, already sorted:
18, 22, 25, 27, 30, 34, 38, 41, 45, 60, 120
Median (Q2): the 6th of 11 values = 34.
Q1: the median of the lower half (18, 22, 25, 27, 30) = 25.
Q3: the median of the upper half (38, 41, 45, 60, 120) = 45.
IQR: 45 − 25 = 20.
So the middle half of customers spend between 25 and 45 dollars. Notice that the 120 order barely affects Q1, Q3 or the IQR, while it would pull the mean upward. That resistance to extremes is the main reason analysts like quartile-based measures, much like the median in the mean vs median vs mode comparison.
Why tools give slightly different answers
There are several accepted methods for computing percentiles (inclusive vs exclusive, different interpolation rules). Excel's QUARTILE.INC and QUARTILE.EXC, Python's NumPy and pandas, and SQL's PERCENTILE_CONT and PERCENTILE_DISC can return slightly different values on small datasets. On large datasets the differences shrink. Pick one method, document it and stay consistent across reports.
Using the IQR to find outliers
A common rule, used by box plots, flags values far outside the middle half:
Lower fence: Q1 − 1.5 × IQR
Upper fence: Q3 + 1.5 × IQR
In our example: 25 − 30 = −5 and 45 + 30 = 75. The 120 order is above the upper fence, so it is a potential outlier worth checking. It could be a bulk buyer, a data entry error or a test order. The rule flags values for investigation; it does not decide whether to delete them. Our guide to outliers covers what to do next.
Reading a box plot
A box plot (box-and-whisker plot) draws quartiles visually. The box spans Q1 to Q3, a line inside marks the median, whiskers extend toward the most extreme values within the fences, and dots show points beyond them. NIST's box plot reference describes the construction. Box plots are especially useful for comparing distributions side by side, such as order values by region or ticket resolution time by team.
IQR vs standard deviation
Both measure spread, but they behave differently:
Standard deviation uses every value and works best with roughly symmetric data. A few extreme values can inflate it.
IQR ignores the top and bottom 25%, so it stays stable with skewed data and outliers.
Rule of thumb: report mean and standard deviation for symmetric data, and median and IQR for skewed data like income, prices, session length or response times.
Where analysts use percentiles every day
Performance monitoring: p50, p95 and p99 latency show how fast a service feels for typical and worst-off users.
Compensation: salary bands are often described by the 25th, 50th and 75th percentiles.
Customer segmentation: top 10% of customers by revenue, bottom quartile by engagement.
Operations: "95% of orders ship within X hours" is a percentile-based service level.
Data cleaning: capping extreme values at the 1st and 99th percentiles (winsorizing) before modeling.
FAQ
Is the 50th percentile always the median?
Yes. The median is the 50th percentile and the second quartile (Q2).
What is the difference between a percentile and a percentage?
A percentage is a proportion (you answered 80% of questions correctly). A percentile is a position relative to others (you scored higher than 80% of test takers).
How do I calculate percentiles in SQL?
Many databases support PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY value) or an equivalent function; check your database's documentation for the exact syntax.
Keep learning with Coderhouse
Describing distributions clearly is one of the first skills that separates a solid analyst from a dashboard builder. Explore the path that fits your goals:
Data Analytics Course — learn SQL, Python, statistics and dashboards to turn raw data into decisions.
Forward Deployed AI Engineering Course — learn to build AI systems and track their latency and quality with the right metrics.
GTM Engineer Course (waitlist) — join the waitlist for early access to the program focused on data-driven, AI-powered go-to-market systems.
I'm Dan Patiño, head of AI Strategy & Innovation at Coderhouse. My day-to-day work involves merging the tactical management of e-commerce (CRO, Email Marketing and SEO) with the development of disruptive solutions. I specialize in building internal AI-powered apps to automate tasks and boost innovation within the team. I firmly believe that technology is strategy's best ally. To dive deeper into my professional journey, I'll be waiting for you on my LinkedIn profile.