The article below originally appeared on MercuryNews.com and is being reprinted with permission.

Several Bay Area educational institutions have pulled spots in the top 20 in a recent WalletHub study ranking the top community colleges across the country, and even higher spots among those in California.

College of San Mateo ranked third in the country, Ohlone College in Fremont took the seventh spot, Las Positas College in Livermore grabbed 14th, and De Anza College in Cupertino was 19th.

Among California institutions, the above colleges were all in the top 10, with College of San Mateo ranked first, Ohlone second, Las Positas fifth, and De Anza ninth.

While overall, community colleges offer a much more affordable education option for prospective students, “individual community colleges…vary in quality and affordability,” WalletHub, a financial advice site, said in its study.

WalletHub’s study, published in August, looked at 18 factors of cost and quality for more than 650 institutions across the country, including the cost of in-state tuition and fees, student to faculty ratio, and retention, graduation, and transfer rates.

Overall, WalletHubranked State Technical College of Missouri as the best community college in the nation.

The Bay Area institutions in the top 20 overall didn’t score very high in the category of “educational outcomes,” which includes measurements for credentials awarded, retention, transfer, and graduation rates.

However, they were all helped by their good scores in “career outcomes,” which includes measurements for the student-loan default rate, the students median salary 10 years after entering the school, and the share of former students earning more than the average high school graduate.

Ohlone scored highest in the “cost and financing” category, which looks at not only fees and tuition, but the amount of financial aid received by students, employment services for students to help offset the cost of attending, per-pupil spending, and faculty salary.

Between 2009-10 and 2019-20, according to nonprofit The College Board, average tuition and fees rose by $670 in 2019 at public two-year colleges, whereas at public four-year colleges, prices jumped by $2,020, and by $6,210 at private nonprofit four-year colleges and universities.