Let M be a type II1 factor and let τ be the faithful normal tracial state on M. In this paper, we prove that given an X∈M, X=X⁎, then there is a decomposition of the identity into N∈N mutually orthogonal nonzero projections Ej∈M, I=∑j=1NEj, such that EjXEj=τ(X)Ej for all j=1,…,N. Equivalently, there is a unitary operator U∈M with UN=I and 1N∑j=0N−1U⁎jXUj=τ(X)I. As the first application, we prove that a positive operator A∈M can be written as a finite sum of projections in M if and only if τ(A)≥τ(RA), where RA is the range projection of A. This result answers affirmatively Question 6.7 of [9]. As the second application, we show that if X∈M, X=X⁎ and τ(X)=0, then there exists a nilpotent element Z∈M such that X is the real part of Z. This result answers affirmatively Question 1.1 of [4]. As the third application, we show that for X1,…,Xn∈M, there exist unitary operators U1,…,Uk∈M such that 1k∑i=1kUi⁎XjUi=τ(Xj)I,∀1≤j≤n. This result is a stronger version of Dixmier's averaging theorem for type II1 factors.