Search Jim Cramer's "Mad Money" trading recommendations using our exclusive "Mad Money" Stock Screener.

If you want to make money in this market, follow the customer, Jim Cramer told his Mad Money viewers Wednesday. Any company that knows what consumers want is flourishing, while those that don't are paying the price.

Case in point: the meteoric rise of Demandware (DWRE) , which gained 56% today on the news that (CRM) - Get Report is acquiring the company. Demandware helps companies stay in touch with customers, which is why Salesforce was willing o pay $2.8 billion for the company.

Why is understanding and connecting to customers so vital? Cramer said because everyone is trying to keep up with (AMZN) - Get Report , which announced that is has 1,000 engineers working on artificial intelligence projects to help understand its customers better than they know themselves.

But it's not just technology companies that are focusing on customers. Cramer said the dollar stores have been excelling at giving customers exactly what they want, including convenience, frozen foods, national brands and seasonal items. Meanwhile, the department stores have suffering from their lack of focus.

Shares of Under Armour (UA) - Get Report have been on the rise thanks to new endorsement deals that have been bringing in customers, while rival Nike (NKE) - Get Report is feeling the sting of its legacy deals that are not performing as well as before.

Cramer said he's not sure how any retailer can compete with Amazon and their artificial intelligence, but he said that any company that knows its customers will continue to be rewarded in this market.

Is US Foods' IPO Good for You?

There are signs of life in the IPO market, Cramer told viewers, but that doesn't mean that every new stock is a good one. He examined the initial public offering of US Foods (USFD) - Get Report , which came public on May 26.

US Foods is our nation's second-largest food distributor behind Sysco (SYY) - Get Report and, along with Sysco, are the only two nationwide food service companies. US Foods serves over 250,000 locations across the country and has 9% market share in a very fragmented industry.

Cramer said while there's a lot to like about US Foods, there are also a bunch of red flags. He was mainly concerned about the company's private equity heritage, which has left it with $5 billion in loans and just $140 million in cash. That means any future acquisitions must dilute current shareholders. Also, shareholders must be concerned about US Foods' two private equity backers making their exits, which will also pressure the stock.

Trading at 44 times earnings, Cramer said he'd take a pass on US Foods and stick with rival Sysco, which trades at 22 times earnings and sports a 2.5% yield.

Home Depot-Lowe's

Investors should love duopolies, Cramer told viewers. One of his favorite duopolies in the home improvement space is Home Depot (HD) - Get Report and Lowe's (LOW) - Get Report .

For ages, Home Depot has been king of the home improvement world, with shares posting a 26% gain in 2015 versus just 10.5% for Lowe's. In fact, throughout all of 2015, Home Depot bested Lowe's with better same store sales growth, better revenue growth and superior gross margins. Thus the markets have been willing to pay a premium for Home Depot shares, and a well-deserved premium at that.

But that all changed this quarter, when Home Depot saw decelerating same-store sales while Lowe's saw a pickup in business with expanding gross margins. This changing of the guard has suddenly made Lowe's the better company with the cheaper stock.

Cramer said while he still thinks Home Depot is terrific, for the moment, Lowe's is the more attractive stock, trading at just 17 times earnings, compared to 18.4 times for Home Depot.

Executive Decision: Mark McLaughlin

For his "Executive Decision" segment, Cramer spoke with Mark McLaughlin, chairman, president and CEO of the cyber-security company Palo Alto Networks (PANW) - Get Report , which just posted a 48% rise in revenue in its most recent quarter.

McLaughlin said cyber threats and cyber security will be an important issue for a very long time to come and a priority spending item for most companies. Uncertainty about the economy is not causing deals to be canceled, McLaughlin noted, only delayed in some cases.

Meanwhile, McLaughlin said that in Asia, new legislation is requiring more companies to report security breaches, helping to make cyber security more top of mind in that region.

When asked about competition, McLaughlin said Palo Alto sells a platform of security products that resonates with customers. He said his company is not trying to take over the entire industry.

With Palo Alto both broadening its market and taking share from other players, Cramer said this stock is a coiled spring set to surge higher.

Lightning Round

In the Lightning Round, Cramer was bullish on CVS Health (CVS) - Get Report , Boston Scientific (BSX) - Get Report , Edwards Lifesciences (EW) - Get Report , Starbucks (SBUX) - Get Report and Pepsico (PEP) - Get Report .

Cramer was bearish on Unit Corp (UNT) - Get Report , New York Mortgage Trust (NYMT) - Get Report and Coca-Cola (KO) - Get Report .

No Huddle Offense

In his "No Huddle Offense" segment, Cramer opined on Zoe's Kitchen's (ZOES) quarterly results, which beat on earnings but also caused some investors to fret over a decline in same-store sales.

Cramer said companies will have growth spurts, but that doesn't mean things have peaked when those spurts end. There simply aren't a lot of restaurant growth stories out there, he noted, which is why if Zoe's declines on this perceived weakness, he'd be a buyer.

To watch replays of Cramer's video segments, visit the Mad Money page on CNBC.

To sign up for Jim Cramer's free Booyah! newsletter with all of his latest articles and videos please click here.

At the time of publication, Cramer's Action Alerts PLUS had a position in PEP and SBUX.