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.