We study the spectrum of the Schr\"odinger operators with $n\times n$ matrix valued potentials on a finite interval subject to $\theta-$periodic boundary conditions. For two such operators, corresponding to different values of $\theta$, we compute the difference of their eigenvalue counting functions via the Maslov index of a path of Lagrangian planes. In addition we derive a formula for the derivatives of the eigenvalues with respect to $\theta$ in terms of the Maslov crossing form. Finally, we give a new shorter proof of a recent result relating the Morse and Maslov indices of the Schr\"odinger operator for a fixed $\theta$.