How to Find Median for Grouped Data in Excel (2 Easy Ways)

It can be challenging to find the median for grouped data in Excel because there isn’t a built in function for it. To find the median for grouped data, follow specific steps and apply a formula. In this tutorial, you’ll learn about median for grouped data and how to find median for grouped data in Excel using two methods. By the end, you can use Excel to calculate the median for any grouped dataset easily.

Key Takeaways

➤ Median for grouped data divides the data into two equal parts. 50% of the observations are lower than the median value, while the other 50% are greater than the median value.
➤ To find median in Excel for grouped data:

  • Calculate the cumulative frequency.
  • Determine the median position: =cumulative frequency/2.
  • The median class is where the cumulative frequency is just greater than or equal to the median position.
  • Median class: =INDEX(cell_range,MATCH(cell_reference,cell_range,1)+1)
  • Lower boundary of the median class, l: =VALUE(LEFT(cell_reference,FIND("-", cell_reference)-1))
  • n/2: =SUM(cell_range)/2
  • Cumulative frequency of the interval before the median interval, cf: =INDEX(cell_range,MATCH(cell_reference,cell_range,1))
  • Frequency of median interval, F: =INDEX(cell_range,MATCH(cell_reference,cell_range,1)+1)
  • Class width, h: =RIGHT(cell_reference,FIND("-", cell_reference)-1)-LEFT(cell_reference,FIND("-", cell_reference)-1)
  • Grouped Median: =l+((n/2 - cf)/F)*h

how to find median in excel for grouped data

In this article, we’ll learn about the median for grouped data and how to find median in Excel for grouped data using the manual method and with functions.

Download Practice Workbook


What Is Median for Grouped Data in Statistics?

Median for grouped data is the value that divides the data into two equal parts. Half of the observations are lower than the median value, while the other half are greater than the median value. Class intervals and frequencies are used to estimate the grouped median, instead of the individual data points.

The formula for calculating the median of grouped data is given below.

Formula for grouped median

where,

l is the lower boundary of the median class.
n is the total number of observations.
cf is the cumulative frequency of the interval before the median interval.
F is the frequency of the median interval
h is the class width.


1

Manual Calculation of Median for Grouped Data in Excel

Consider the student height (cm) dataset, which contains the height range and frequency in columns A and B.

Student height dataset for how to find median in excel for grouped data

For example, we want to know the median height for the grouped data shown above. Just follow along.

The manual approach for calculating the grouped median is simple and suitable for learning, especially with small datasets.

Steps:

➤ Enter the formulas in cells C2 and C3 >> Drag the Fill Handle tool to get the cumulative frequency. The cumulative frequency will equal the summation of all the frequencies (76).

=B2

=B3+C2

Finding cumulative frequency

➤ The formula for the median position is total frequency divided by two (n/2).

=C11/2

Locating median class

➤ The median class is the interval where the cumulative frequency is just greater than or equal to the median position. For example, the cumulative frequency greater than or equal to the median position is 42, which lies in the interval 165-170.

how to find median in excel for grouped data using manual method

➤ Plug the values in the formula to get the median height of 168.33cm.

=165+((C11/2-C6)/B7)*5

how to find median in excel for grouped data using manual method


2

Finding Median for Grouped Data with Functions

Once you’ve learned the calculation procedure, it’s time to use functions to make the calculations dynamic. In this approach, we’ll make the determination of the median for grouped data dynamic using functions. It is well suited for large datasets where manual calculation would take a lot of time and for minimizing errors.

Steps:

➤ Calculate the cumulative frequency as shown previously.

=B2

=B3+C2

cumulative frequency

➤ Determine the median position.

=C11/2

median position

➤ We can use INDEX-MATCH functions to identify the interval/class that contains the median value. The median interval/class is 165-170.

=INDEX(A2:A11,MATCH(B13,C2:C11,1)+1)

Looking up median interval with INDEX MATCH function how to find median in excel for grouped data

➤ Obtain the lower boundary (l) of the median class using the formulas below. For earlier versions of Excel, combine the VALUE, LEFT, and FIND functions. In newer versions, use the TEXTBEFORE function.

=VALUE(LEFT(B14,FIND("-", B14)-1))

Or

=VALUE(TEXTBEFORE(A7,"-"))

finding lower boundary how to find median in excel for grouped data

➤ Divide the total frequency by two to calculate the n/2 value.

=SUM(B2:B11)/2

Calculating n/2 values

➤ Again use INDEX-MATCH functions to calculate the cumulative frequency of the interval before the median interval (cf).

=INDEX(C2:C11,MATCH(B13,C2:C11,1))

Obtaining cumulative frequency of the interval before the median interval

➤ Extract the frequency of the median interval (F)

=INDEX(B2:B11,MATCH(B13,C2:C11,1)+1)

Frequency of median interval how to find median in excel for grouped data

➤ Calculate the class width (h)

=RIGHT(B14,FIND("-", B14)-1)-LEFT(B14,FIND("-", B14)-1)

class height

➤ Plug all the values in the formula to calculate the grouped median.

=B15+((B16-B17)/B18)*B19

how to find median in excel for grouped data using functions

Optional Formatting

This is an optional step to highlight the class/interval containing the median. This is a dynamic formatting that will be applied automatically, provided the necessary inputs are given.

Select the entire data range (A1:C11) >> In the Home tab, click on Conditional Formatting >> New Rule.

Applying conditional formatting how to find median in excel for grouped data

➤ Select the option Use a formula to determine which cells to format.
➤ Enter the formula below. This formula matches the calculated median class from the entire data range and highlights the row where the condition is TRUE.

=$B$14=$A1:$C11

Using formula to determine formatting

➤ Click the Format button >> Font tab >> Select Bold.

Choose bold font

➤ In the Fill tab >> Choose a fill color (Orange, Accent 2, Lighter 80%).

Select a fill color

➤ The row containing the median class will be formatted.

Applying formatting how to find median in excel for grouped data

Explanation
➥ Of the 76 students, half are shorter than the median height of 168.33 cm, and the other half are taller.
➥ The median for this grouped data lies in the 165-170 cm interval.


Frequently Asked Questions

How do you find the median of grouped data?

Median for grouped data: =l+((n/2-cf)/F)*h

where,

➤ l is the lower boundary of the median class.
n is the total number of observations.
cf is the cumulative frequency of the interval before the median interval.
F is the frequency of the median interval
h is the class width.

Why is class width (h) used in the formula?

A uniform distribution is assumed within the class interval because the exact values within each class are unknown.

What is the formula for the median in Excel?

=MEDIAN(cell_reference)

How do you calculate a median if in Excel?

Single criteria: =MEDIAN(IF(criteria,cell_reference))

Multiple criteria: =MEDIAN(IF((criteria1)*(criteria2),cell_reference))

Multiple criteria: =MEDIAN(FILTER(array,(criteria1)*(criteria2)))

For earlier versions of Excel, press  Ctrl + Shift + Enter  to apply this array formula. For newer versions, just press  Enter .

How to find the median of ungrouped data?

➤ Using Excel: =MEDIAN(cell_reference)

Or

➤ Manually: Arrange the data from smallest to largest. If there is an odd number of data points, median is the middle value (n/2). If there is an even number of data points, median is the average of the two middle values =1/2 * (n/2 + (n/2 +1))


Wrapping Up

In this tutorial, we’ve learned about grouped median and how to find median for grouped data in Excel manually and with functions. Feel free to download the practice file and share your thoughts and suggestions.

ExcelInsider Team
We will be happy to hear your thoughts

Leave a reply

Excel Insider
Logo