What happened

Not for the first time this year, Costco Wholesale (COST -0.14%) did better than the broader stock market on Tuesday. Shares of the big retailer eked out a 0.4% gain on a day when many other titles tanked notably, and the S&P 500 index was dragged down by 1.5%. An analyst's recommendation upgrade was a major factor in helping Costco stock defy gravity.

So what

The upgrading party was Northcoast Research's Chuck Cerankosky. Before market open on Tuesday, he changed his recommendation for the better; Costco is now a buy, according to him, where previously it was merely a hold.

In a fresh research note on the popular retailer, Cerankosky said that its second-quarter results not only topped expectations, it positioned the company for a solid second half of its current fiscal year despite macroeconomic concerns that haven't entirely faded from investor consciousness.

The analyst wrote the following:

Costco has been here before. At these times, its strong value proposition in consumables -- from food to pharmacy and HBC to household supplies to gasoline -- not only allows it to retain its many loyal members but attract new ones.

Now what

Cerankosky also wrote glowingly of Costco's "impeccable" balance sheet, which gives the company the financial muscle to pay an anticipated special dividend, plus a potentially quite large share-repurchase program. The prognosticator sees both occurring in the next one to two years; he speculated that a potential special dividend could amount to $10 per share at a minimum.