Can someone explain to me the intuition for the formula for finding the percentile of a value in a data set? Basically, my math textbook just gave me the formula without any explanation on about the "why"/intuition of the formula. Here's the text from the book: 
• Order the data from smallest to largest.
• x = the number of data values counting from the bottom of the data list up to but not including the data value for which you want to find the percentile.
• y = the number of data values equal to the data value for which you want to find the percentile.
• n = the total number of data.
• Calculate $\frac{x + 0.5y}
{n}
(100)$. Then round to the nearest integer.
 A: The percentile is another representation of the 'ranking' of a person. So if there are 100 people with unique ranks, a person at the 25th rank will be at the 75th percentile because there are 75 people after him, i.e., 75% of the candidates are below him. Hence the percentile for people with unique ranks will be expressed as a percentage by $$\frac{x}{n} \cdot 100$$
Now if there are $y$ people having the same rank, I believe the book is placing the candidate's rank in the middle of the range. So it says that there are $(x + 0.5)$ people less than this rank. Hence the ranking expressed as a percentage becomes:
$$\frac{x+0.5y}{n}\cdot 100$$
A: The percentile $p \times 100\%$ is the value $v$ below which we have close to $p \times 100\%$ of the values of the data (I used the term "close" because if data is discrete we may not be able to get exactly $p \times 100\%$ of the values).
If all the data values are different, the value at position $x+1$ in ascending order will be an estimate of the percentile
$$
\frac{x+0.5}{n} \times 100\%
$$
If you have repetitions you have to take that into account, and the value halfway through the repeated values will be an estimate of the percentile
$$
\frac{x+0.5y}{n} \times 100\%
$$

On a side note, the formulas you presented are one of the possible ways to estimate the percentiles.
