How to Find a Median With an Algorithm

How to Find a Median With an Algorithm thumbnail
A median is easy to calculate using a spreadsheet program.

A median, not to be confused with an average or mean, is defined as the value in a set of numbers for which no more than half the numbers are lesser and no more than half the numbers are greater. It is used in certain situations, such as calculating the value of a typical home in a certain community, in which a few very large or very small numbers might skew a straight average. Using an algorithm, or a step-by-step procedure, to find a median can be fairly easy.

Things You'll Need

  • Set of numbers
  • Spreadsheet software program
Show More

Instructions

    • 1

      Define your set of numbers. Whether you need to find the median single-family home value in a city or town, or the median number of nails in several boxes, the numbers must all represent exactly the same element so that you don't end up comparing dissimilar values.

    • 2

      Sort the numbers from smallest to largest or vice-versa. The easiest way to do this is by using a spreadsheet program. Import or enter your set of numbers into the program, and arrange them in either ascending or descending order. It doesn't matter which.

    • 3

      Find the median. If you have an odd number of values in the set, this means simply choosing the middle value. For example, if you have 15 numbers arranged from smallest to largest, the median is the eighth number. If an even number of values are in the set, take the average of the middle two numbers. For instance, if 16 values are included, the median is the average of the eighth and ninth values. To get the average, add the two middle numbers together and divide by two.

Tips & Warnings

  • If you don't have a spreadsheet program or don't know how to use one, you can write the numbers manually on a piece of paper from lowest to highest, then find the median as explained.

Related Searches:

References

Resources

  • Photo Credit number background image by kuhar from Fotolia.com

Comments

You May Also Like

Related Ads

Featured