How to Calculate Class Width in Excel

To calculate class width in Excel, you need to first enter the data in a table format and then calculate the range of each class by subtracting the lowest value from the highest value. Then, divide the range of each class by the number of classes to find the width. The final step is to adjust the width to a convenient value. This can be done by dividing the width by a divisor that will give you a rounded result.


In a frequency distribution, class width refers to the difference between the upper and lower boundaries of any class or category.

For example, the following frequency distribution has a class width of 4:

Frequency table in Excel

e.g. – the class width for the first class is 5-1 = 4. The class width for the second class is 10-6 = 4, and so on.

And the following frequency distribution has a class width of 9:

Frequency distribution in Excel

e.g. – the class width for the first class is 10-1 = 9. The class width for the second class is 20-11 = 9, and so on.

If you have a raw dataset of values, you can calculate the class width by using the following formula:

Class width = (max – min) / n

where:

  • max is the maximum value in a dataset
  • min is the minimum value in a dataset
  • n is the number of classes you want to use

The following example illustrates how to calculate class width for a dataset in Excel.

Example: How to Calculate Class Width in Excel

Suppose we have the following dataset of 20 values in Excel:

Raw data in Excel

To calculate the class width for a frequency distribution of this dataset, we simply need to decide how many classes we want to use. Suppose we want to use n = 5. Then we can use the following formula to find the class width:

Class width calculation in Excel

Lastly, we can create a frequency table that uses a class width of 5:

Class width calculation in Excel

Notice that the width for each class is 5 and the sum of the values in the “Frequency” column adds up to 20, which matches the total number of values in our dataset.

x