In general fundamental analysis is of two types which are quantitative and qualitative analysis. Quantitative analysis is what you are asking which is all about analysing the financials i.e. profit and loss statements or balance sheet statements, computing various ratios and then drawing investing decisions. On the other hand, quantitative analysis is all about analysing qualitative features such as management, employees etc. The P/E ratio is the price-earnings ratio. The formula of computing this ratio is hidden in its name i.e. P/E ratio= Market Price/Earning per share.
Now, you can easily get the market price of the share and earning per share is obtained by dividing profit after tax by the number of issued shares. In general, there are two ways through which the P/E ratio is calculated one through the past year profits and the second through estimated profit. Now, coming to analysis P/E ratio is the amount that an investor is ready to spend to earn 1 rupee on that share. For instance, if the P/E ratio is 10 then an investor is ready to spend 10 rupees for earning 1 on that share. As a thumb rule, you can take lower P/E as a cheap stock but there are certain exceptions to this rule because the stock price of certain stocks can be reduced due to some market news as capital markets are mostly governed by the psychology of traders. You can also judge this by comparing your selected stock to two parameters first to the stick of the competing company and second to the industry average.
Now, coming to the P/B ratio, it is a price to the book ratio. The formula for computing it is, Share price/Book value per share. Book value is nothing but obtained by deducting liabilities from the assets of the company. After obtaining book value, divide it by the total number of shares to get book value per share. It depicts the amount an investor is ready to pay for obtaining 1 rupee of a net asset in that company. For instance, if the P/B ratio is 10 then the investor is ready to pay 10 rupees for every 1 rupee of net assets. There is no certain parameter but this ratio can not be applied to companies that have very low net assets like IT companies or other service providers companies because they are dependent on their employees. Also, for those companies whose assets are highly depreciating or can't be liquidated easily because of their obsolete models, we can not rely on their book value as accounts are maintained on the historical cost. So, as such, there is no general rule in the stock market but through regular watch, on the market and deep analysis, an investor can draw better conclusions.