Stock index is average of stock prices and stock value. We can calculate it either using of price weighted method or market capital weighted index method.
In price weighted index method, we take the sum of 30 stocks of popular companies (in India, we take sum of 50 popular companies' stock price. Now, we will divide it index divisor
Sum of Stocks of 30 companies / Index Divisor = Index Average.
Index divisor is Dow Jones Industrial Average
Sum of Stocks of 50 companies/ Index Divisor = Index Average.
Index divisor is Index value in base period / Stock price in base period, it may be 1978-79 or 1995
In this method, we calculate market capitalization of famous companies. It may be 30 or 50.
= No. of shares outstanding X market price of share
Sum of Market Caps / Divisor = Stock Index Average
Sensex = (Sum of free float market cap of 50 major companies of BSE) X Index Value in 1978-79 / Market cap value in 1978-1979
NIFTY = (Sum of free flow market cap of 50 major companies of NSE) X Index Value in 1995/ Market cap value in 1995