There is no shortage of advice on how women can get to the top. They should lean in, they should stop apologizing, they should go for the most competitive jobs out there, they should take on as much responsibility as possible.

Harvard Business School graduates Sarah Dillard and Vanessa Lipschitz decided to take a look at the women of the Fortune 500 to see how they actually got to the top and if all of this advice rings true. And despite the fact that Dillard and Lipschitz had always been told to go after the biggest jobs in investment banking and management consulting, the 24 women of the Fortune 500 didn't necessarily take that road. Granted it's a small sample size, but the findings are interesting nonetheless.

In a blog post for Harvard Business Review, Dillard and Lipschitz dissected the paths of 24 Fortune 500 women, and they found that only three of them had a job at a consulting firm or bank right out of college. Twenty percent of them took their first jobs at the companies they currently run. For example, Mary Barra, the CEO of General Motors, started out at the company as a college co-op student. Kathleen Mazzearella, the CEO of Greybar, started out as a customer service representative at the supply chain management company.

More than 70 percent of the women spent at least ten years at the company they currently run. Even the ones who may not have climbed ladder at their current company worked their way up at another company only to make a lateral move to become CEO at a new one. Take Patricia Woertz, CEO of food processing company Archer Daniels Midland, for example. She spent more than 29 years at Chevron only to become CEO of ADM. Same with Sheri McCoy who worked at Johnson & Johnson for 30 years before becoming CEO at Avon.

The median amount of time spent at a company before becoming CEO was 23 years. Dillard and Lipschitz pulled a random sample of their male counterparts in the Fortune 500 and found that the median stint was 15 years. Additionally, 71 percent of the female CEOs were promoted as long-term insiders compared to 48 percent of the male CEOs.

It seems that the loyal and long tenure is what really moved these women's careers forward. The long and steady climb got them where they are today.

Not only that, but about 75 percent of the entire Fortune 500, men and women alike, never found themselves in consulting or banking jobs. And they didn't go all go the best schools either. Only two of them women and four percent of the men on the list went to an Ivy League school for their undergraduate degree.

Similarly, only a quarter of the women and 16 percent of the men got an MBA from a top-ten school. They worked their way to the top by sticking to the long-tenure path.

It is possible that times have changed since these middle-age CEOs began climbing the ladder, but it is still noteworthy that they didn't need to be the most impressive or prestigious as twenty-somethings.

Another takeaway from this analysis is that if you're going to stick with one company for the long-run, you better find a company with the right culture that will support your growth. For women, that means finding a company that promotes equal opportunity, offers helpful mentorship, and fuels female ambition.

"There is something inspiring for young women in the stories of these female CEOs: the notion that regardless of background, you can commit to a company, work hard, prove yourself in multiple roles, and ultimately ascend to top leadership," Dillard and Lipshchitz write. "These female CEOs didn't have to go to the best schools or get the most prestigious jobs. But they did have to find a good place to climb."