NEW YORK ( TheStreet) -- When it comes to the upcoming presidential election, "the markets need certainty," Jim Cramer told his "Mad Money" TV show viewers Wednesday. He said that in the end, it doesn't matter who wins, but until the markets have certainty, they'll likely continue to like stocks one day and hate them the next. Cramer said he's often asked which candidate would be best for the markets, but in the end it's certainty that makes markets rally. He said that with the economy picking up steam, it appears that Obama would be hard pressed not to get a second term. But then again, if the economy falters on continued European worries, it's possible that Mitt Romney would prevail. Cramer noted that if Obama wins, investors would need to continue to steer clear of the banks and take profits in any health care names they own. He said investors would also need to be careful with any fossil fuel stocks as well, as they remain on the president's hit list. Cramer said he would favor the dollar stores and would still embrace gold on an Obama win. However if the Republicans prevail, Cramer said the investing options would become greater. He said that oil and gas stocks would be the big winner, as would the banks and anything that's cyclical since Republicans would likely aid in more GDP growth than Obama. But Cramer said the real win for stocks and the economy would be any serious reigning in of our out-of-control entitlement spending. He said if that problem is ever fixed, the market's multiple would skyrocket. Until then, Cramer concluded, the markets just need certainty. Until they get it, investors will continue to buy and sell stocks based on the latest news and poll results.