# How to Calculate Class Width in Excel

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:

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:

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:

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:

The class width is 4.6. For convenience, we typically round up to the nearest integer so in this case we will use 5.

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

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.

## One Reply to “How to Calculate Class Width in Excel”

1. Jay salvatore says:

The class width from 1-6 is not 5 , it is 6. Yes 6-1 = 5 but that’s not how you determine it. Simply count the unit in the class, you’ll notice 6: 1,2,3,4,5,6. To determine the class width , subtract lower limit of a class boundary form its upper limit 6.5 – 0.5 = 6 or you can subtract the lower limit from upper limit of two successive classes 12-6 = 6 or 7-1 = 6