There are books on the subject of valuing stocks.
P/E ratio has nothing directly to do with the value of a company. It may be an indication that the stock is undervalued or overvalued, but does not indicate the value itself.
The direct value of company is what it would fetch if it was liquidated. For example, if you bought a dry cleaner and sold all of the equipment and receivables, how much would you get?
To value a living company, you can treat it like a bond. For example, assume the company generates $1 million in profit every year and has a liquidation value of $2 million. Given the risk profile of the business, let's say we would like to make 8% on average per year, then the value of the business is approximately $1/0.08 + $2 = $14.5 million to us. To someone who expects to make more or less the value might be different.
If the company has growth potential, you can adjust this figure by estimating the estimated income at different percentage chances of growth and decline, a growth curve so to speak. The value is then the net area under this curve.
Of course, if you do this for NYSE and most NASDAQ stocks you will find that they have a capitalization way over these amounts. That is because they are being used as a store of wealth. People are buying the stocks just as a way to store money, not necessarily make a profit. It's kind of like buying land. Even though the land may never give you a penny of profit, you know you can always sell it and get your money back.
Because of this, it is difficult to value high-profile equities. You are dealing with human psychology, not pennies and dollars.