Here is what he says of his time at West Point (Summer 1836 to Spring 1840, graduating at age 20):
[I graduated] in June, 1840, number six in a class of forty-three. These forty-three were all that remained of more than one hundred which originally constituted the class. At the Academy I was not considered a good soldier, for at no time was I selected for any office, but remained a private throughout the whole four years. Then, as now, neatness in dress and form, with a strict conformity to the rules, were the qualifications required for office, and I suppose I was found not to excel in any of these. [....] My average demerits, per annum, were about one hundred and fifty, which reduced my final class standing from number four to six.
Sherman -- one of the Civil War's greatest generals -- having had a non-stellar performance as a cadet at West Point ("I was not considered a good soldier"), suggests that it's hard to predict real-life performance based on academic performance. Consider the following West Point class rankings of Civil War generals:
- Lee: 2nd of 46 graduating cadets [Class of 1829]
- Sherman: 6th of 43 [Class of 1840]
- Longstreet: 54th out of 56 [Class of 1842]
- Grant: 21st of 39 [Class of 1843]
- McClellan: 2nd out of 59 [Class of 1846]
- Stonewall Jackson: 17th out of 59 [Class of 1846]
- Pickett: 59th of 59 [Class of 1846]
I see no relation between skill as a general and class-rank at West Point; McClellan and Lee were both second in their classes, but McClellan is widely considered a total failure. He was humiliated repeatedly be Lee, till Lincoln fired him. Grant, with only an average performance, turned out to be a military genius. Longstreet was one of Lee's best subordinate commanders, but was at the bottom of his class.
Note that the cadet who ranked first in the Class of 1846 never made it higher than colonel during the Civil War!