Home Depot's (HD -0.74%) stock ended the trading session on Dec. 7 at an all-time high price of $416.18 a share. The home improvement retailer has been a surprise winner since the pandemic started, with people focusing their discretionary dollars on sprucing up their living quarters. Home Depot stock is up a remarkable 160% since March 20, 2020. 

With the stock still near its all-time high, you might be wondering if Home Depot is a good investment right now. 

A Home Depot employee uses a mallet to seal a paint can sitting on a table in a Home Depot store.

Image source: Home Depot.

Another strong quarter 

The company reported another outstanding quarter of earnings (for the third quarter ending Oct. 31), beating Wall Street's consensus forecasts for both the top and bottom lines. Revenue of $36.8 billion and diluted earnings per share of $3.92 were 9.8% and 23.3% higher, respectively, than the prior-year period. Same-store sales (or comps) increased 6.1% year over year. Given the tough comparison to Q3 2020, this was a great report from Home Depot. 

For the third consecutive quarter, sales from professional customers, which include contractors, plumbers, and electricians, outpaced the DIY segment. During the depths of the pandemic, consumers held off on more complex projects because they weren't comfortable letting outsiders into their homes, a dynamic that has since reversed. Nearly half of Home Depot's sales come from Pros, so it's extremely positive to see this customer cohort bouncing back nicely. 

Although customer transactions fell 5.5% in the third quarter, the average ticket size rose 12.9% partly as a result of inflation across a range of product categories. Home Depot's operating margin was 15.7%, and the company's return on invested capital ROIC) was a superb 43.9%. Both the operating margin and ROIC figures beat those of rival Lowe's because Home Depot has a larger Pro business, with professional contractors who visit frequently and spend more, leading to better financial metrics. 

According to management, the fourth quarter was off to a fantastic start. "The comp sales for the first two weeks of the fourth quarter are running a little higher than what we reported for the entirety of the third quarter," CFO Richard McPhail highlighted on the Q3 earnings call 

Industry tailwinds 

One of the most important trends boosting Home Depot's business is rising home prices. Aided by a massive housing shortage in the U.S., median prices in October increased 13% year over year to $378,700, marking the 15th straight month of double-digit gains. The popularity of remote work has caused many Americans to reevaluate their living situations, supporting activity in the housing market as well. 

Rising values have a wealth effect on consumers, who view renovation projects as investments in their homes. Tapping into soaring home equity is a way to fund projects. According to data from CoreLogic, U.S. homeowners with mortgages added $3.2 trillion of home equity during Q3, 31.1% higher than the prior-year period. 

And even as the Federal Reserve plans to raise interest rates at some point in 2022, they will still be at historic lows. Therefore, I don't view this as a potential headwind for Home Depot's business. 

If, however, consumers shift their spending away from home improvement projects to other retail categories, demand for Home Depot could weaken. This would certainly pressure the stock. But based on the most recent quarter's financial results, the company's momentum right now couldn't be stronger. 

An appealing valuation for a quality business 

As of Dec. 13, Home Depot's stock traded at a price-to-earnings (P/E) ratio of 27, the second-highest level it's been over the past decade. The S&P 500's P/E ratio is almost 29, so Home Depot looks like an attractive stock to own based just on this comparison. But the business is significantly better than the average company out there, which strengthens the bull case for the stock right now. 

Thanks to steadily increasing revenue and profit over its long history, Home Depot has already proven its investment merits. And because of its massive scale in the home improvement industry, the company is a fundamental part of the U.S. economy today. Even near its all-time high, I think the stock deserves serious consideration as an investment for your portfolio.