Median is the middle most value of a series. So when the series has odd number of elements then median can be calculated easily but when the series has even number of elements then the series has two middle values, so median is calculated by taking out the average of both the value.
The series is first arranged into either ascending or descending order. The formula to calculate median = (N+1) /2 th term of the series where N is the number of observation in the series.
The given series is first arranged into ascending; 2,4,5,6,7,8,9.
N= 7
median= (7+1)/2 th term = 8/2 th term = 4 th term = 6.