Finding companies that can thrive during all market conditions is critical in investing. These companies can make up the backbone of your portfolio, as they exhibit more stability compared to some high-risk, high-return investments.

In my portfolio, Alphabet (GOOGL -1.11%) (GOOG -1.16%) and Autodesk (ADSK -1.80%) fill this role, as each has been able to steadily deliver positive business results despite a challenging economic environment. With each stock's current valuation, I also think now is an excellent time to add these two to your portfolio.

Alphabet

Alphabet is more commonly known by the products under its umbrella: Google, YouTube, and the Android operating system. Although the company has multiple products, 78% of its revenue is derived from advertising-related sources. This poses a threat during economic uncertainty, as advertising budgets are the first item to be reduced when a company is looking to save on costs.

Although we have seen a general decline in advertising spending over the past year and a half, the Google Search segment of Alphabet remained steady, with revenue rising 2% in the first quarter. While that's not light-speed growth, it shows that clients see the Google Search engine as a "must-spend" location.

This cements Alphabet as a company that will steadily grow or maintain its revenue, regardless of economic sentiment. However, Alphabet's revenue has historically risen directly after a recession, as clients are willing to spend more on ads across the board, which drives up the price per ad.

GOOGL Revenue (Quarterly YoY Growth) Chart

GOOGL Revenue (Quarterly YoY Growth) data by YCharts

After we either experience a recession or emerge from one, Alphabet's revenue growth will likely see a substantial uptick. However, with the stock trading at 26 times earnings, it shows Alphabet has reached a fair valuation for its current business state.

Once the economy kick-starts again, Alphabet's stock will look cheap. For example, an average of 38 Wall Street analysts predicts Alphabet's 2024 earnings per share will come in at $6.25. That values Alphabet's stock at 20 times 2024's earnings, a reasonably cheap price to pay for a company as dominant as Alphabet.

With that in mind, Alphabet's stock seems like a no-brainer buy right now. However, you must hold the stock for at least three years to benefit from Alphabet's recovering business following an economic downturn.

Autodesk

Some fields require certain software to deliver products to clients. In the engineering and architecture field, Autodesk meets that requirement. With its suite of computer-aided design (CAD) products, Autodesk finds itself in a unique place among software companies. Should the economy get worse, Autodesk's products aren't in danger of being eliminated (although some clients may reduce their number of seats). Furthermore, Autodesk charges its clients on a subscription basis, so customers can't wait a year before upgrading to the latest edition.

This makes for a stable business, and Autodesk has displayed strong growth since transitioning to a subscription business model.

ADSK Revenue (Quarterly YoY Growth) Chart

ADSK Revenue (Quarterly YoY Growth) data by YCharts

It's also geographically diversified, with 44% of revenue coming from the Americas, 37% from Europe, the Middle East, and Africa, and 19% from Asia-Pacific. This stabilizes the company if one region sees incredible growth while another experiences a recession.

The stock also doesn't look that expensive, as it trades at 28 times forward earnings. Although that's close to where Alphabet trades at now, Autodesk has earned a premium because of its subscription business model, as it isn't as prone to economic uncertainties as advertising is.

Autodesk makes for a great software company to balance out other high-flying ones. With the stock trading at a reasonable valuation, now is an excellent time to buy.