Shares of office supply company Staples (SPLS) have crashed so far this year, down about 23%, as multiple disappointing earnings reports have caused violent fluctuations in the stock price. Almost all of the gains of 2013 have been completely wiped out, and the company is struggling to grow both revenue and earnings. What's behind this terrible performance? And, more importantly, can Staples turn things around?

SPLS Chart

SPLS data by YCharts

Retail trouble
The largest part of Staples' business is its North American retail operation, and while comparable-store sales have been declining for quite some time, profits from the segment started to collapse in 2014. During the most recent quarter, North American retail contributed almost nothing to Staples' operating profit.

Source: Staples

There are two issues driving Staples' poor retail performance. First, there's the general shift in consumer habits toward e-commerce. Staples does have a large e-commerce business; nearly half of its total sales are done online. However, margins tend to be lower online, and that's a contributing factor to Staples' falling profits.

Second, demand for core office supplies is weak. Staples has taken steps to combat this, mainly expanding its product offerings to include additional categories, but so far it hasn't slowed down the deterioration of its stores. The commercial delivery segment has benefited, however, with sales growing and margins remaining strong during the most recent quarter.

Staples is actively closing hundreds of stores while downsizing others, and this should ultimately help profitability by consolidating sales at fewer stores. So far, though, there has been no sign of any meaningful improvement in the retail segment. This poor retail performance has been the main reason for the stock's dreadful showing this year, and it will take clear signs that the retail operation is getting better for the stock to follow suit.

Can Staples make a comeback?
I suspect that the days of Staples being able to generate high-single digit operating margins from its retail segment have come to an end. The continued rise of e-commerce, along with weak demand for the products that Staples is known for, are trends that are here to stay. However, this doesn't mean that Staples can't operate its stores profitably.

The effects of the store closings and remerchandising will play out over years, not quarters, and while the retail business currently looks abysmal, I expect profitability to eventually improve. Growing online sales will be critical for Staples, and already the company has managed to accelerate sales at Staples.com. During the most recent quarter, Staples.com sales rose by 8% year-over-year, an acceleration from the 3% growth during the same quarter of 2013.

Staples' commercial business has proven to be resilient, and during the next few years as Staples continues to fix its retail business, profits from the commercial segment should keep Staples firmly in the black. Staples still expects to generate about $600 million of free cash flow this year despite the terrible retail performance, a benefit of not being a strictly consumer-facing retailer.

There are plenty of things that could go wrong for Staples going forward. Demand for office supplies could contract even faster than management expects, and new categories may not be able to pick up the slack. Rival Office Depot, which is also closing hundreds of stores, could prove to be a more effective competitor than it has been in the past, and that could hurt both Staples' retail and commercial businesses.

Despite these risks, I believe that Staples can recover from its current difficulties, and when this happens, the stock will likely recover as well.

The bottom line
Staples has the benefit of not depending entirely on retail, and that's significant given that the collapse of the stock has been the result of poor retail performance. Finding the right store count and the right product mix will take time, but I'm confident that Staples can turn things around, albeit at lower margins than in the past. Until then, the stock will likely stay depressed, but for long-term investors, Staples is an interesting turnaround play.