Duke University and the University of North Carolina at Chapel Hill are among the best-value colleges in the country, according to a new ranking.

Forbes magazine ranked the top 300 colleges in the country, taking into account several metrics from each school. Alumni earnings, student debt, on-time graduation and tuition, among others, were used to define the schools with the best value.

Duke ranked No. 12, and UNC landed in the No. 15 slot. North Carolina State University was ranked No. 115.

With an in-state tuition of just under $13,000, the University of California at Berkeley was ranked the best-value school in the country. The Berkeley campus was followed by the University of California at Los Angeles, Princeton University, the University of Florida and Harvard University.

The top 15, including tuition (in-state tuition is listed for public schools):

1 University of California, Berkeley ($12,972)

2 University of California, Los Angeles ($12,705)

3 Princeton University ($41,820)

4 University of Florida ($6,313)

5 Harvard University ($43,938)

6 Massachusetts Institute of Technology ($45,016)

7 Stanford University ($45,195)

8 University of California, Irvine ($13,179)

9 University of California, Davis ($13,896)

10 Brigham Young University ($5,000)

11 University of California, San Diego ($13,427)

12 Duke University ($47,243)

13 Yale University ($45,800)

14 Rice University ($40,566)

15 University of North Carolina at Chapel Hill ($8,336)