Normalization in Excel scales data to a 0–1 range, ideal for non-Gaussian distributions. Standardization adjusts data to a mean of 0 and standard deviation of 1.
1. Normalization (Or Min-Max scaling) of Data in Excel
It is the process of scaling data in such a way that all data points lie in a range of 0 to 1. Thus, this technique, makes it possible to bring all data points to a common scale. The mathematical formula for normalization is given as:
X^{'} = \frac{X - X_{min}}{X_{max}-X_{min}}
Where,
- X is the data point,
- Xmax and Xmin are the maximum and minimum values in the group of records respectively.
Example:
Let's have a look at one example to see how can we perform normalization on a sample dataset. Suppose, we have a record of the height of 10 students inside a class as shown below:
Height (in cm) |
---|
152 |
155 |
168 |
175 |
153 |
162 |
173 |
166 |
158 |
156 |
Step 1: Calculate the minimum value in the distribution. It can be calculated using the MIN() function. The minimum value comes out to be 152 which is stored in the B14 cell.
Calculating the minimum value using the MIN() functionStep 2: Calculate the maximum value in the distribution. It can be calculated using the MAX() function. The maximum value comes out to be 175 which is stored in the B15 cell.
Calculating the maximum value using the MAX() functionStep 3: Find the difference between the maximum and minimum values. Their difference comes out to be 175 - 152 = 23 which is stored in the B16 cell.
Calculating the difference (Max-Min)Step 4: For the first data stored in the A2 cell, we will calculate the normalized value as shown in the below video.
Calculating the normalized value for the first elementStep 5: We can manually calculate all values one by one for each data record or we can directly get values for all the other cells using the auto-fill feature of Excel. For this, go to the right corner of the B2 cell until a (+) symbol appears, and then drag the cursor to the bottom to auto-populate values inside all the cells.
Calculating the normalized value for the entire rangeNote: While calculating the first normalized value in the B2 cell, it should be made sure that the reference address for the B14 and B16 cells should be locked using Fn + F4 button otherwise an error will be thrown.
If we have a close look at the results, we can notice all the values lies in the range 0 to 1.
2. Standardization (Or Z-score normalization)
Standardization is a process in which we want to scale our data in such a way that the distribution of our data has its mean as 0 and standard deviation as 1. The mathematical formula for standardization is given as:
X^{'} = \frac{X - X_{mean}}{\sigma_{_{x}}}
Where,
- X is the data point,
- Xmean is the mean of the distribution
- σx is the standard deviation of the distribution.
2.1. Method 1: Calculating z-score normalization manually
Step 1: Calculate the mean/average of the distribution. It can be done using the AVERAGE() function. The mean value comes out to be 161.8 and is stored in the B14 cell.
Calculating the mean value using the AVERAGE() functionStep 2: Calculate the standard deviation of the distribution which can be done using the STDEV() function. The standard deviation comes out to be 8.323994767 which is stored in the B15 cell.
Calculating the standard deviation using the STDEV() functionStep 3: For the first data stored in the A2 cell, we will calculate the standardized value as shown in the image given below.
Calculating the standardized value for the first elementStep 4: After manually calculating the first value, we can simply use the auto-fill feature of Excel to populate the standardized values for all other records.
Calculating the standardized value for the entire range using auto-fillNote: While calculating the first standardized value in the B2 cell, it should be made sure that the reference address for the B14 and B15 cells should be locked using Fn+F4 button otherwise an error will be thrown.
2.2. Method 2: Calculating Z-score normalization using the STANDARDIZE() function
We can even use the built-in STANDARDIZE() function to find the standardized value of an element. The syntax for STANDARDIZE() function is given as:
=STANDARDIZE(x,mean,std_dev)
Where,
- x is the specific element/range of cells,
- mean is the average/arithmetic mean of all the elements in the record,
- std_dev is the standard deviation of all the elements in the record
Step 1: Calculate the mean/average of the distribution. It can be done using the AVERAGE() function. The mean value comes out to be 161.8 and is stored in the B14 cell.
Calculating the mean value using the AVERAGE() functionStep 2: Calculate the standard deviation of the distribution which can be done using the STDEV() function. The standard deviation comes out to be 8.323994767 which is stored in the B15 cell.
Calculating the standard deviation using the STDEV() functionStep 3: For the first data stored in the A2 cell, we will calculate the standardized value as shown in the below image.
Calculating the standardized value for the first element using the STANDARDIZE() functionStep 4: After manually calculating the first value, we can simply use the auto-fill feature of Excel to populate the standardized values for all other records.
Calculating the standardized value for the entire range using auto-fill