When I purchase a stock, my goal is to never need to sell it. I have this mindset because I'm investing in the company, not just an arbitrary ticker. However, there are times as an investor when you may see an opportunity and need to raise capital.

To raise capital, I sold my entire Nvidia (NVDA 6.18%) position. While this may be a head-scratcher to some due to the company's immense artificial intelligence (AI)-influenced upside, the stock is currently trading as if this shift has already occurred. Read on to find out my thinking for selling Nvidia and if you should follow suit.

Nvidia's business prospects are strong, despite a weak environment

To be clear, I believe in Nvidia as a company. Its graphics processing units (GPUs) are best-in-class and have a massive role in the future AI rollout. Its track record speaks for itself, with 361 of the most powerful supercomputers worldwide utilizing its products.

Even if AI doesn't turn out to be as large of a market as many think it will be, Nvidia's data center and gaming business are still lucrative fields. Although gaming is currently down due to weak personal computer (PC) demand, new iterations of GPU technology will create further demand, and this segment should continue to rise. Data centers follow a similar line of thinking, as the migration to the cloud is still occurring at a large scale, even if it might slow down as businesses clamp down on spending to prepare for a potential recession.

The problem with Nvidia isn't Nvidia; it's the stock valuation.

At 29 times sales, Nvidia isn't too far off of where it was when it crashed down to earth in late 2021.

NVDA PS Ratio Chart

NVDA PS Ratio data by YCharts

Furthermore, 29 times sales is nearly double its average valuation (although sky-high COVID-19 valuations heavily skew this average) and is a level that almost no company can reliably sustain, even with rapid revenue growth. With Nvidia's revenue shrinking (it fell 21% year over year in Q4 of fiscal year 2023, ending Jan. 29), this valuation makes little sense.

It also implies that the stock will have little upside even if the company returns to growth mode.

The implied growth Nvidia must achieve seems unobtainable

I like to take a five-year minimum view when assessing if a company is worth investing in. Using that mindset, let's look at what growth Nvidia has to put up for 29 times sales to make sense.

Judging a mature company by its sales isn't wise, as investors really care about profits. But, with Nvidia's profitability rapidly decreasing thanks to its demand evaporation, it's not a useful metric. However, we can still utilize it while looking forward.

Nvidia is a cyclical company whose profit margins can rise and fall with the economy. Just look at the swings it has experienced during its long history.

NVDA Profit Margin Chart

NVDA Profit Margin data by YCharts

Because of that, I'll assign a long-term average profit margin of 25% to Nvidia. At 29 times sales, that would imply a 116 times earnings valuation at its long-term average profit margin -- an extremely high level.

Now, we need to assess how much Nvidia needs to grow to achieve a more reasonable 30 times earnings valuation in five years. Using the compound annual growth rate (CAGR) formula, we can determine Nvidia would need to grow revenue by 31% annually over the next five years to reach 30 times earnings. Keep in mind that's with no stock price growth for five years. 

Plus, it would imply Nvidia would need to sell $104 billion in products. For reference, Apple sold $385 billion in products last year, and Tesla generated $86 billion. While GPU demand may rise in the next couple of years, I doubt it's to that implied level.

As a company, Nvidia has a fantastic product line and a great leadership position in its field. However, the stock implies growth rates that are too high to make sense, so I'm selling my shares to invest in more attractive opportunities. While this action may not be suitable for everyone, I believe it's in my portfolio's best interest to make this move. Of course, it's also possible I could be wrong and regret this decision, but it will just be another great learning opportunity.