Whether to use the median or the average (also known as the mean) depends on the characteristics of the data and the question you are trying to answer.
The median is often used when there are outliers or extreme values in the data that could skew the average. For example, if you have a set of test scores and one student got a 100, while the rest of the scores were in the 70s and 80s, the average would be skewed by the high score. In this case, the median would be a better measure of central tendency, as it would represent the score in the middle of the range of scores.
The average is often used when the data is distributed normally or evenly around a central value, and there are no extreme values that would significantly affect the calculation. For example, if you have a set of heights for a group of people, the average would give you a good representation of the typical height in the group, assuming that there are no extreme values (such as a professional basketball player) that would skew the calculation.
In general, if your data is skewed or has extreme values, the median may be a better measure of central tendency. If your data is normally distributed and has no extreme values, the average may be a better measure. It’s also possible to use both measures and report them both, along with other measures of dispersion (such as the range or standard deviation), to give a more complete picture of the data.