Sometimes it feels like every other entrepreneur makes it big on their first try, which can be frustrating for founders who are struggling to turn a profit. But the reality is that companies that seem to appear out of thin air are often run by entrepreneurs who have faced multiple failures before finally succeeding. Take a look at these five founders who weren’t successful on their first tries.

Simon Cowell

Now the producer of a wide range of television programs and the founder of entertainment firm Syco, Cowell experienced a failed venture early in his career. After working briefly at EMI records, he created his own record company, Fanfare Records. Although the company had some early successes, it wouldn’t last. In 1989, the firm went under and Cowell ended up moving back into his parents’ house.

“I’ve had many failures,” Cowell later said. “My record company going bust, that was the first big one.” But even the famously acerbic celebrity saw the silver lining in his failure. “Losing everything is probably the greatest lesson you learn,” he said. “I went back to my parents’ house and started again.”

Walt Disney

Today, the name Disney is associated with everything from the original Mickey Mouse icon to Marvel and Star Wars. But before becoming a household name, Walt Disney faced a series of failures and struggled to make money.

During Disney’s early ventures, he created cartoon sketches called “Laugh-O-Grams” and made simple animated advertising films that were to appear in movie theaters. But a New York-based film distributor cheated Disney and his partner out of money, prompting bankruptcy.

After that, Disney moved west, and in 1927, he created his first clips introducing Mickey Mouse. Featuring the newly launched sound available in movies, Disney became a trailblazer in the animation category, but that wasn’t the end of his troubles. He still struggled financially, partly due to the fact that his new ventures needed more funding infusions than he was earning. He persevered, and eventually ended up turning a profit, ironically, during the Depression.

Nick Woodman

The GoPro founder didn’t find instant success in his entrepreneurial journey. Before launching the camera firm, Woodman started a social gaming site known as Fun Bug. The company stayed in business for several years, but when it sold at a loss, $4 million in investors’ cash went with it. Woodman was just 26 when the venture failed, but he learned a lot from it.

“Fun Bug was hugely traumatic, not because I’d failed, but because people believed in me and I let them down,” he said. But he remained optimistic, and encourages other entrepreneurs to do the same. “Don’t give up,” he said. “Lots of these ideas fail, but many don’t.”

Milton Hershey

Now one of the most famous names in the candy industry, Milton Hershey wasn’t an immediate success when he started as a confectioner. When his first candy operation closed due to lack of funds, he moved from Pennsylvania to Colorado to shift into the caramel industry. He took the lessons he learned back to the east coast, where he tried to sell candies on the streets of New York, but that venture failed as well.

He turned to his home state of Pennsylvania, where his relatives were so frustrated with his failure to launch that they wouldn’t give him seed funds to try again. With help from a friend, he began experimenting with different chocolate recipes, and a year later he started the Hershey Chocolate Co. in 1905. That business was a booming success, and his recipes continue to find massive followings.

Bill Gates and Paul Allen

The Microsoft founders were young when they launched their famous brand, but it wasn’t their first venture. Back when Gates was 17 and Allen was 19, they tried their first entrepreneurial idea with the launch of Traf-O-Data. The company was born after Gates’ summer job exposed him to the punch-card process of counting the cars that drove over pressure-sensitive tubes on the road. To make the process more efficient, the duo aimed to translate that paper process into a computer-based one.

The computer would create data charts that showed hourly traffic flow, and it worked so well that the firm remained in business for years and was profitable. But eventually, as competitors joined the market, Traf-O-Data went under.

“In hindsight, Traf-O-Data was a good idea with a flawed business model,” Allen later said. “We had done no market research. We hadn’t foreseen how hard it would be to get municipalities to make capital expenditures, or that officials would be reluctant to buy machines from students.” Ultimately, Allen said, it’s possible that Microsoft wouldn’t have existed without the lessons learned from Traf-O-Data’s creation and failure.