Principal component analysis is a multivariate statistical method frequently used in science and engineering to reduce the dimension of a problem or extract the most significant features from a dataset. In this paper, using a similar notion to the quantum counting, we show how to apply the amplitude amplification together with the phase estimation algorithm to an operator in order to procure the eigenvectors of the operator associated to the eigenvalues defined in the range $\left[a, b\right]$, where $a$ and $b$ are real and $0 \leq a \leq b \leq 1$. This makes possible to obtain a combination of the eigenvectors associated to the largest eigenvalues and so can be used to do principal component analysis on quantum computers.