With all the distressing signals about the state of the economy, you might think that now's not a good time to invest in the stock market. But that would be a mistake, because, as is the case in many areas of life, challenges often represent the greatest opportunities.

Sometimes those opportunities lie in the tanked stocks themselves. Target (TGT -0.36%) stock is down 32.6% this year after missing on first-quarter earnings and presenting a bleak near-term outlook. But at the current price, shares trade at only 12 times trailing 12-month earnings, and its long-term potential is huge. 

Other opportunities might be in stocks that are swimming against the tide and posting healthy growth in an otherwise murky atmosphere. Costco Wholesale (COST 1.01%) might fall into that category. Its stock price has fallen along with the market this year, and last week it plunged after other retailers posted disappointing first-quarter results. Shares are now trading at 35 times trailing 12-month earnings, after falling 23% year to date. But shares could rise tomorrow. Here's why.

Two people filling a car with grocery bags.

Image source: Getty Images.

Earnings may paint a different picture

Both Target and Walmart (WMT -1.75%) were caught off guard by rapid changes in consumer spending habits. These are large, experienced, well-run companies, and both expected changes as shoppers have different priorities in this latest phase of the pandemic. So it's fair to say the unexpected earnings reports were more indicative of the economy than of poor management. 

But Costco operates a slightly different model, and is therefore generally more resilient to economic difficulties. Customers pay an annual membership fee of either $60 (basic) or $120 (executive), and they clearly find it a valuable resource; retention rates are over 90%, and Costco adds millions of members annually. Once members are paying that annual fee, they want to get their money's worth and therefore regularly shop at Costco. Customers generally find that fee to be worthwhile: Due to Costco's low markups, they they save money on each shopping trip. 

The best comparisons to Costco are BJ's Wholesale Club and Walmart-owned Sam's Club. BJ's also announced first-quarter earnings last week, which were much more positive than other mega-retailers. Comparable sales increased 14% year over year (although without gas, they were 4%), and membership fees increased 12%. More telling, earnings per share increased 39% over last year, but merchandise gross margin rate, which excludes gas and membership fees, decreased 30 basis points due to supply chain issues and inflation.

As for Sam's Club, Walmart CEO Doug McMillon said on the first-quarter earnings call, "Transactions were up in Q1, overall membership count continued to grow, plus member penetration reached another all-time high, and we saw good growth in e-commerce." Comparable sales increased 10.6% year over year, the ninth consecutive quarter of double-digit year-over-year comps increases (without fuel and tobacco). Margins, however, were pressured by "supply chain costs, fuel mix, inflation, and markdowns caused by inventory delays."

Another reason to expect a positive report from Costco tomorrow is that we already know a lot about the quarter. Costco has already reported that March sales increased 19% over last year, and April sales increased 14% over the same month in 2021. While the company doesn't report monthly earnings or margins, higher sales typically translate into higher profits, even if they may have been somewhat eaten away by higher costs and too much inventory. What's more, Costco has also already updated shareholders that it's dealing with these more macroeconomic issues by building out a company-owned supply chain, which should ease some pressure on its margins.

Should you buy Costco stock today?

The signs are all pointing in Costco's favor, and if the report shows increased growth and expanded margins, the stock price is likely to pop after earnings are released at the end of the trading day. As a potentially good omen, BJ's stock price jumped when it reported earnings last week.

Since the price is so low now, it might be a good time to buy shares. However, there's no guarantee that the release will be positive or that the price will increase after the release, no matter what management has to say. Instead, investors should focus on Costco's long-term outlook and how its fundamentals can support future growth. While a price dip is a great buying opportunity, you can't time the market, and you should look for companies with strong potential at a fair price.