Abstract We extend Vétois’ Obata-type argument and use it to identify a closed interval I n I_{n} , n ≥ 3 n\geq 3 , containing zero such that if a ∈ I n a\in I_{n} and ( M n , g ) (M^{n},g) is a compact conformally Einstein manifold with nonnegative scalar curvature and Q 4 + a σ 2 Q_{4}+a\sigma_{2} constant, then it is Einstein. We also relax the scalar curvature assumption to the nonnegativity of the Yamabe constant under a more restrictive assumption on 𝑎. Our results allow us to compute many Yamabe-type constants and prove sharp Sobolev inequalities on compact Einstein manifolds with nonnegative scalar curvature. In particular, we show that compact locally symmetric Einstein four-manifolds with nonnegative scalar curvature extremize the functional determinant of the conformal Laplacian, partially answering a question of Branson and Ørsted.