As a single entity, the stock market did fairly well today. But Walgreens Boots Alliance (WBA 0.57%) did exceptionally well, with its share price closing more than 3% higher on the day compared to the S&P 500 index's 0.1% rise. That isn't surprising in retrospect, as the pharmacy chain operator reported encouraging quarterly results.

Sales and profitability increases, and a double beat

For its fiscal second quarter of 2024, Walgreens booked just over $37 billion in sales, which was a 6% improvement over the same period of fiscal 2023. On the bottom line, non-GAAP (adjusted) earnings edged up slightly to land at $1.04 billion, or $1.20 per share.

With those numbers, Walgreens easily topped the consensus analyst estimates. These predicted the company's sales would total $35.9 billion, and adjusted per-share net income would amount to only $0.82.

A focus on cost savings and profitability boosting is the goal for this year, Walgreens said in its earnings release. The company aims to save $1 billion in costs this year and pledged to continue "strategically reviewing" its asset portfolio. It's already moving on this goal, as it booked a $5.8 billion impairment charge on its investment in VillageMD, an operator of health clinics. Walgreens plans to shut more than 160 VillageMD outlets.

Full-year bottom-line guidance is adjusted

Walgreens also revised its full-year fiscal 2024 profitability guidance. Management now believes the company will net an adjusted profit of $3.20 to $3.35; it trimmed the upper end of that range from the previous $3.50. It said this was due to a "challenging retail environment," among other factors.