Sometimes you have to admit your mistake and move on. That's exactly what Shopify (SHOP 1.11%) management did when it sold its shipping logistics division business earlier this year. While it parted with that business at a loss, the transformation since that decision has been remarkable.

Since splitting its stock in June 2022, Shopify's stock still hasn't regained the levels it was at before the split. But I wouldn't be surprised if the new and improved Shopify can start clawing its way back to a new all-time high of $170.

Shopify's software focus is key to success

Shopify's mission is to make commerce better for everyone. Namely, it gives the little-to-medium guy a chance to fight in the e-commerce battle even while other industry giants have superior resources. By deploying Shopify's products, small and medium-sized businesses can go toe-to-toe with larger competitors and not be outclassed.

Shipping logistics used to be a part of this scheme, but after realizing the sheer amount of resources needed to build out this product, management decided to cut it loose and move back to its bread and butter: software.

This decision made management look like geniuses in Q3, as Shopify could finally reverse the trend of posting negative operating margins since Q2 2022. Its operating margin was 7.1% in Q3, and was helped by declining operating expenses and cost of revenue.

Even though its logistics business is gone, Shopify still grew revenue at 25%, which would have been 30% if the logistics business weren't included in the comparison. That displays how much of a drag this unit was on Shopify. For Q4, Shopify expects another strong quarter, although not as good as Q3, with revenue growth in the high teens. But management also projected low-twenties percent growth when it gave its Q3 guidance during its Q2 earnings report, so there may be another surprise ahead for investors.

But is Shopify's stock a buy? After all, it's up nearly 80% this year.

The stock may be pricey, but don't expect it to get cheaper

Even though Shopify's stock has had a remarkable 2023, investors must consider the low point at which it entered the year. At the start of the year, Shopify's stock was trading below pre-2020 prices, which is unbelievable considering the business gains it has made over that time.

Now that the stock has recovered, the valuation becomes a lot more important to consider. With the stock at just over 12 times sales, it's not what many investors would describe as "cheap," even if it's near the lowest the stock has ever been valued.

SHOP PS Ratio Chart

SHOP PS Ratio data by YCharts

But with Shopify's improving margin picture, its valuation could make more sense as it grows. With Wall Street projecting 19% growth in 2024, Shopify should see its business expand considerably.

So does all of this add up to an investible stock? I'd say yes. Shopify's reach is incredible, and it has a strong grasp on the important small and medium-sized business market. While I'm likely overpaying for the stock now, I predict Shopify will grow into its valuation and will likely not get much cheaper. As a result, I have to pay a bit to own a best-in-class company, but I think it will be a market-beating stock over the next five years.