Software stocks have struggled lately, but the pullback has created some buying opportunities, CNBC's Jim Cramer said on Thursday.
While the "Mad Money" host said there's reason for slight caution, the software stocks with "the best fundamentals and the most reasonable valuations" are worth adding to your portfolio, Cramer advised.
"Today the cloud stocks proved they can bounce, and after months of agony, even after this evening's Amazon shortfall ... I think you can start gradually — not all at once, don't be a hero — buying the highest quality names here," Cramer said.
The S&P 500 software and services ETF rose more than 1% on Thursday, though it's still down around 8% from its late July high.
"I think we've got a lot more reason to be constructive than we did a month ago. In mid-September, we conducted a damage assessment for you where I warned you that the cloud cohort had further to fall," Cramer said.
At the time, Cramer advised viewers to sell most of their software stocks, many of which continued to struggle in the following weeks.
Before recommending whether to buy on the pullback, Cramer said he had to determine if it was caused by a general shift in sentiment or a shift in fundamentals for the sector.
It was the former late last year, when software stocks were hurt by the market-wide selloff.
"During last year's meltdown, the cloud software cohort fell 32% from peak to trough, over a period of 76 days," Cramer said. "Compare that to right now: This group was now down 33% as of yesterday, having been hit for 103 days."
But the other comparable decline for software stocks happened in early 2016, Cramer said. In that case, the broader sector was pushed down by severe shortfalls from Tableau Software, which was bought by Salesforce in June, and LinkedIn, which has been acquired by Microsoft.
"When you look at the cloud stocks that were publicly traded back then, they racked up an average of 46% decline from peak to trough," Cramer said. "Even the best of them, Adobe, lost 26% of its value. It was truly a panic. While you still got an amazing buying opportunity, you had to be patient and wait for the carnage to unfold. Many people started too early."
Evaluating the current situation requires more nuance, Cramer cautioned, but overall, he said he still sees opportunity.
On one hand, Workday CEO Aneel Bhusri said last week that the company's "definitely seeing some delays" in orders, and its stock responded by dipping from $180 to $160 in a day.
Workday's warning means "we need to be a little more alert for signs of actual weakness," Cramer said.
But with Thursday's rally, Cramer said there is also reason to be optimistic, namely a strong quarter Wednesday from both ServiceNow and Microsoft.
"There's no reason to question the drivers in the software-as-a-service space," Cramer said.
"But keep some powder dry in case they get high once again, and we've got a 2016 scenario on our hands and not a 2018 one," Cramer added.
Disclosure: Cramer's charitable trust owns shares of Microsoft, Twilio and Salesforce.com.