# What is the mathematical forumula for finding the median of a odd number of values

• 04-07-2011
Programmer_P
What is the mathematical forumula for finding the median of a odd number of values
Sorry if this is too basic a question to ask here, but thought I'd ask it anyway. :p
What is the mathematical formula for finding the median (i.e. the number in dead center) in an odd number of values? You can't divide the sum by 2, because that will give you one less than the center and a half. Do I just add an half after dividing by 2, or is there a better way?

EDIT: Yeah, the above seems to work...
• 04-07-2011
phantomotap
Quote:

Lies!

Soma
• 04-07-2011
Programmer_P
Quote:

Originally Posted by phantomotap
Lies!

Soma

forumla for median of odd number - Google Search

The first couple of results didnt look like it had it, so I didn't go over them that deeply. But checking again, I see a couple of them did, but I missed that before. So its (x+1) / 2, where x is the total number of values. Oh well... :p
• 04-07-2011
brewbuck
There is no "formula" for it. Sort the list of values, then take the middle one.
• 04-07-2011
MacNilly
Quote:

Originally Posted by brewbuck
There is no "formula" for it. Sort the list of values, then take the middle one.

Right. And if I recall correctly, to find the median of an even number of values you take the mean of the two adjacent values.
• 04-07-2011
new_ink2001
For reference, the (arithmetic) mean of two numbers xi and xj is

Code:

```   (xi + xj)/2```
Best Regards