In the formula section of Sloane's integer sequence A060652 - Orders of non-Abelian groups , we find
Let the prime factorization of $n$ be $p_1^{e_1}\cdots p_r^{e_r}$. Then $n$ is in this sequence if $e_i>2$ for some $i$ or $p_i^k \equiv 1 \pmod {p_j}$ for some $i$ and $j$ and $1 \le k \le e_i$.
While the formulation only says "if", not explicitly "if and only if", it better be listed as the formula only if it actually is an "if and only if". But is it?
Note that the "if" part is clear: Whenever the criterion holds, we can take direct product with a non-abelian factor $Z_p^2\rtimes Z_p$ or $\Bbb F_{q^k}\rtimes Z_p$ where $p$ divides $|\Bbb F_{q^k}^\times |$. But as $PSL_2(7)\not\cong (\Bbb F_8\rtimes Z_7)\times Z_3$ shows, not all non-abelian groups are obtained in this way this argument suggests (even though $168$ does fit the criterion).