What is Nifty/Sensex?
The Nifty and the Sensex are both stock indexes.
The Sensex is an index of 30 top( large, well-established and financially sound companies across key sectors) companies from the Bombay Stock Exchange, where as Nifty is an index of the 50 top companies traded in the National stock exchange.
How do you form an index:
The market capitalization of the index is found out based on the free float market capitalization(M) of individual companies.
M=( Total shares* Market price each share* Free float ratio).
The free float ratio is nothing but the percentage of the company’s outstanding shares that are present with the general public.
The total market cap for the Sensex is merely the summation of these 30 Ms.
How do you calculate the value of the sensex:
Day0: The base value of the stock index is 100 for the Indian exchanges(A standard default, set when the indices were made). Let is assume that X=100crores (i.e the sum of all the market caps of the index is 100 crores)
Day1: On day 1 lets assume that X goes up to 105 crores. This is a 5% increase, and is reflected by the sensex going up to 105.
On any given day you can calculate the value of the Sensex by this formula
The value of either indices thus increases or decreases based on the performance of the stocks that are a part of that index.
Based on my Quora answer