Boston magazine names Cambridge the 25th-best public school district in Massachusetts in the September issue, editors said in a Monday press release.

A year ago the magazine, which claims a monthly circulation of more than a half-million readers, called CRLS one of the top 20 public high schools — specifically, No. 16.

With 351 cities and towns, Massachusetts has literally dozens of public school districts (including some combined). The magazine crunched the numbers in an exclusive ranking of “the best” public school districts — 135 out of a total 390 — and biggest values in the area, the release said. Rankings were based on data gathered from consulting school officials and websites, as well as the Massachusetts Department of Education.

Determining factors of the district rankings includes test scores from elementary, middle and high schools; per-pupil spending; student-to-teacher ratios; number of advanced-placement classes; graduation rates; the percent of students who continue to college; and the amount of sports teams and clubs. George Recck, director of the Math Resource Center at Babson College, calculated the mean scores for each category and ranked the districts based on a weighted average of each school data point’s difference from the mean.

In this case, Cambridge benefits from the methodology. MCAS scores in the district were mixed in September, with Adequate Yearly Progress seen for the district in English language arts and math but lacking in certain subgroups, leading Superintendent Jeffrey Young to say, “We’ve made progress, but the gaps are persistent and unacceptable to all of us in the Cambridge Public Schools and the Cambridge community.”

On the other hand, spending per pupil is so high at $25,737 that Young was asked to give a presentation this spring comparing where the money went with spending in his previous district, Newton. And Cambridge clubs are generally considered good, with some at the high school (and programs such the urban gardening organization CitySprouts) generally drawing special notice.

“I find these type of lists interesting, but whether good or bad I never think of them as the end-all, be-all of describing school districts. There’s so much that goes into it that you couldn’t tell from a list,” said Marc McGovern, vice chairman of the School Committee, giving a classic example: “We try to balance our desire to do well on MCAS and not become a district where that’s all we care about.”

“You always have to look at it in context,” McGovern said of the ranking. “But it’s better to be higher than lower, I guess.”

Young was unavailable for comment Monday.