It's basically impossible to explain how to calculate glycemic index because the glycemic index of various foods are measured experimentally. Which is why we have to rely on glycemic index charts and glycemic load charts provided by scientific and nutritional researchers.
Glycemic index is measured by giving 10 test subjects 50 grams of a test food, and then measuring their blood glucose response over a two hour time period. That response is then compared against a reference food (glucose) and averaged across all 10 subjects to get a relative index value. (For a more detailed explanation see What is a Glycemic Diet).
The GI and GL of a food are related by the amount of available carbohydrates in a fixed serving of the food.
The glycemic load of a food is calculated by multiplying the absolute GI value by the grams of available carbohydrate in the serving, and then dividing by 100. Or:
GL = GI * Available Carbs (grams) / 100
Reversing the equation:
GI = GL *100 / Available Carbs (grams)
Note that Available Carbs is equal to the total carbohydrate content minus the fiber content.
For example, a 225 g (1 cup) serving of Bananas with a GI of 52 and a carbohydrate content of 45.5 g (51.4 g total carbohydrate - 5.9 g fiber) makes the calculation GL = 52 * 45.5 / 100 = 24, so the GL is 24.