For a bounded operator that is not a sum of scalar and compact operators and is similar to a diagonal operator, we prove that it is a linear combination of three idempotents. It is also proved that any self-adjoint diagonal operator is a linear combination of four orthoprojectors with real coefficients.