Answered this question on Quora
Subtract Cash from the market value before dividing by earnings.
There is a very good reason why this is done.
Let’s say you are looking at a company A that is trading at $15/share with earnings of $1/share in the last 12 months. The P/E ratio is 15
Also consider another company B that is trading at $15/share with earnings of $1/share in the last 12 months. The P/E ratio is 15 as well.
Company A has $5/share on the books but only needs $2/share to run its business.
Company B has $3/share on its books and only needs $2/share to run its business.
Which stock is more attractive to you?
If you are still thinking they look similar, think of it from the perspective of someone who is interested in acquiring the entire company.
With Company B, this person can spend $15/share to buy $1/share of earnings and possibly pocket the extra $1 on the company books ($3/share cash – $2/share company needs to run its business)
With Company A, this person can spend $15/share to buy $1/share of earnings and pocket the extra $3 on the company books.
in essence, this acquirer would only spend $15 – $3 = $12 to acquire $1 of earnings for Company A, while for company B he would spend $15 – $1 = $14 to acquire $1 of earnings.
The Company A is actually cheaper.
Ex- Cash P/E ratio will approximately tell you that company A is cheaper. The regular P/E ratio will not give you this detail.