Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

You and your office pool didn't win the record-large Powerball this week, but at least all those tickets you bought will help support local schools — right?

Not necessarily.

Use of lottery funds varies by state, but even when states earmark money from ticket sales for education — as many advertise they do — schools don't always get a financial windfall, experts say.

"Revenues generated from lottery have very little or no impact on overall education spending," said Lucy Dadayan, a senior policy analyst at the Nelson A. Rockefeller Institute of Government, an Albany, New York, think tank.

The reason: State legislatures often use the millions of dollars that come in from the lottery as an opportunity to reallocate other funds intended for schools from the state's general revenue, making the overall education budget barely higher than it was before lottery money was added.

In Virginia, for example, where the lottery used to boast "Helping Virginia's Public Schools" on the back of tickets, 30 percent of ticket sales went to K-12 public education in the 2015 fiscal year, according to Virginia Lottery spokeswoman Jill Vaughan. At $534 million, that sounds like a lot of money — but the number can be deceiving.

Related: Powerball Jackpot Hits Staggering $1.5 Billion

"The state legislators added the funding in to the budget, and then they take it out," said John O'Neil, communications director for the Virginia Education Association, an organization of more than 50,000 teachers and school professionals.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Ultimately, every dollar in funding for our school helps," he said. "[But] the important thing is that it needs to be an extra dollar."

And in many cases, it's not, said Patrick Pierce, a professor of political science at St. Mary's College in Notre Dame, Indiana, who has researched how states use lottery revenues.

But that's not the fault of the lotteries — it's because of state legislators.

"There's nothing explicitly scandalous or corrupt about what happens. The money certainly goes where they [the lottery] say it's going to go," he said. "You can think of it as revenue substitution."

Charles Pyle, a spokesman for the Virginia Department of Education, denied to NBC News that there were any substitutions.

"When the budget in Virginia is developed, it's based on estimates and projections of all the revenue sources, both general fund and non-general fund estimates, which would include what the projection is for lottery proceeds," he said. "Then that budget is presented to the legislature."

Research from Pierce and others shows it does happen, though. Lottery revenue goes toward a variety of initiatives, including veterans' programs, police and firefighter pensions, and environmental causes, but education is the biggest area it funds, Pierce said.

According to the North American Association of State and Provincial Lotteries, nearly $18.1 billion went to state budgets nationwide in the 2014 fiscal year. Every state that has legalized gambling has a commission that oversees how the funds are spent, but it varies state-by-state.

Related: How Big Will the Tax Bite Be If You Win the Powerball Jackpot?

"There's no unifying entity that handles any of this," Pierce said.

How much a state taxes a winning lottery ticket also varies — and what happens to taxable earnings is even more murky.

"While direct revenue from the lottery ticket sales is often earmarked for education or other purposes, the taxes collected on winnings are not," said Ross Rubenstein, a professor of public management and policy at Georgia State University in Atlanta.

While schools don't always end up getting that much more bang for their buck once lottery revenue is added to state education budgets, the lottery pays for a number of other education initiatives. In Georgia, for example, the Helping Outstanding Pupils Educationally (HOPE) Program has given more than $6.4 billion to students attending Georgia colleges, and is paid for entirely by the lottery.

"Those programs might not exist at all without the lottery," Rubenstein said.

O'Neil, of the Virginia Education Association, said the $7 billion that the lottery there has given to Virginia schools since 1999 has funded "a lot of valuable programs," and said the issue isn't so much where the money is coming from, but whether lawmakers are putting enough of it toward education.

"It doesn't really matter to the teacher where the money comes from," he said. "What matters is that it's enough to support quality schools."