Warren Buffett has been the world's most famous value investor for decades, and he's always on the lookout for deals. But just because the Oracle of Omaha and his company Berkshire Hathaway appreciate a good bargain, that doesn't mean that cheap stocks are the only ones they buy.

Buffett prioritizes a quality business above all else, and one quote of his summarizes that best: "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price."

Why investors should always remember the quote

This is a valuable reminder that while investors should be looking for deals, that doesn't mean you should attempt to wait until a stock hits rock bottom to add it to your portfolio. Nor should you buy shares of a mediocre company just because it's trading at a lower earnings or sales multiple than a wonderful company. While valuation metrics can be helpful in comparing stocks, they shouldn't be your only criterion.

For example, Walgreens Boots Alliance (WBA -0.16%) might appear to trade at a wonderful price of just 6 times earnings, and the stock is near its 52-week low, but it also comes with risks. While Walgreens' dividend has an attractive yield of 5.4% at the current share price, the business itself doesn't look all that strong. It often nets single-digit percentage profit margins -- and sometimes even falls into the red.

The company is also in the midst of broadening its operations into primary care, a venture that may or may not prove to be successful. Overall, Walgreens is what I'd call a fair business, and one that may not be worth picking up, even if the price does appear to be wonderful.

An example of a wonderful business

Wonderful businesses, on the other hand, can and often do trade at premiums, precisely because they are wonderful. If a company is profitable and has attractive growth prospects, it's easy to see why investors may flock to its shares and drive its valuation up.

Healthcare company Eli Lilly (LLY -0.21%) is an example of what I would consider to be a wonderful business. It is immensely profitable and has a promising pipeline of treatment candidates, including a potential weight-loss treatment in Mounjaro that some analysts believe could become the first drug to bring in $100 billion in revenue.

The company already has a strong business that has been growing over the years, from $22.3 billion in revenue in 2019 to $28.5 billion this past year. And it also posts strong profit margins in excess of 20%.

But the stock's price-to-earnings ratio of 48 may scare away investors looking for a deal. The good news is that if you're planning to buy and hold for at least five years, that multiple could come down over time as the business continues growing and its earnings rise.

Eli Lilly is an example of a wonderful business that perhaps may never get to a wonderful price, but instead may remain at a fair price which, given its growth potential, could be where it is right now.

Cheap doesn't mean good value

There are many cheap and beaten-down stocks that investors can choose from in the market. But that doesn't mean that they're all good buys or that there is good value there.

For investors, the focus should remain on finding wonderful, profitable businesses that can be worth hanging on to for the long haul. Worrying too much about the price and valuation can mean missing the boat on wonderful businesses that may never fall to deeply discounted prices.