When finding the upper and lower quartiles of a data set with an odd number of observations, there are different conventions which can lead to the inconsistencies you mentioned. There are two common methods: including the median value in both the upper and lower sets, or excluding it.
1. Including the median in both sets: In this method, the median value is included in both the upper and lower sets. This means that when finding the upper quartile, the median value is also counted as part of the upper set.
2. Excluding the median: In this method, the median value is not included in either the upper or lower sets. When finding the upper quartile, the median value is disregarded and not counted in the upper set.
Both methods are technically correct, but they can yield slightly different results. The method used may depend on the context or the specific convention followed in a particular field of study or statistical software. It is important to clarify which method is being used when interpreting or comparing quartile values.