The technical details of this is found in inspired by: https://www.youtube.com/watch?v=dbF6tnZDzCQ which gave a good explanation of how to calculate or create your own share index. The aim of this post is to give a bit more explanation and details.
Firstly, what is a share index and why do we need them? Put simply, a share index is a collective representation of a group, or basket, of shares. Instead of looking at the share price of an individual company, a share index price is the collective price of a group of shares. In the U.S. three of the popular Share Indices are the Dow Jones (a group of 30 companies), the Top 500 (a group of 500 companies) and the Nasdaq (a group of technology companies). The purpose of a share index is to provide a collective view so that it represents the market as a whole. Individual company share price may move up or down, but collective a share index give an overall picture of the market.
Secondly, as mentioned above there are many different share indices and they are created to represent different group of companies or different sectors in the market or even different countries. So it is up to the creator of the index to decide which stocks to include.
Thirdly, another variable in the share index is the amount of each of the specific stock. For example do we include 5 shares of Apple stocks and 10 shares of IBM stocks? The amount may be a reflection of which stocks we like to see having more or less in.
Here is a very simple example.
Step 1: Choose Stocks A, B, C; each with a certain amount; ie. number of shares, say 5, 10, 15. The share prices could be $1, $2, $3. Multiply the respective amount by share prices and add together. So $5 + $20 + $45 = $70. This represents Day 1's total Basket value. This is not the share index price yet.
Step 2: Choose an arbitrary starting value of the index. This may be the most difficult to understand. Simply don't think about this step and choose a nice round number. Say 100 or 1000 or something. This is the Share Index price on Day 1.
Step 3: Repeat Step 1 for Day 2. Let's say the result of the Basket is $75.
Step 4: The Share Index on Day 1 is say 100. Now to calculate the Share Index on Day 2, it is:
ShareIndexDay2 = (BasketDay2 / BasketDay1) * ShareIndexDay1
= (75/70) * 100.
Step 5: For Day 3, the Share Index price would be:
(BasketDay3 / BasketDay2) * ShareIndexDay2
= (BasketDay3 / BasketDay2) * (BasketDay2 / BasketDay1) * ShareIndexDay1