The solution to this is a Purcell Prussik, that looks like this,
It's a cordelette tied into a loop with a double fisherman's, and then looped back with a prussik to itself. See here for how to tie one.
If I need more slack, I reach up and pull the prussik towards myself, if I need to go shorter I push it up towards the anchor.
It is important that the loop with two strands goes to the climber, as otherwise, you won't be able to adjust the knot without climbing back to the anchor when it is fully extended.
The other thing to note is that the double fishermans won't go through the prussik, so you want it as close to the side that goes to the anchor as possible but not directly on it.
Finally, note that this should only be used with a cordelette made out of nylon cord and will not work with a cordelette made from dyspectra/dyneema or webbing as it will likely slip.
If you need to shorten one, you can tie a figure eight on bight on the part of the cordelette that goes to the anchor and clip the bight to the anchor.
Close up of the prusik,
For those doubting this as an acceptable solution,
The testing conducted on Purcell Prusiks was by no means a comprehensive examination. However, the testing conducted certainly suggests that a Purcell Prusik constructed out of 6mm cord with a 3-wrap prusik hitch meets the recommended lanyard performance guidelines of being able to withstand a fall factor 1 event with acceptable levels of MAF and no observable degradation of the lanyard. The testing also demonstrates that the margin over and above that
minimum performance criteria is approaching the 50% level at fall factor 1.5.
The Purcell Prusik used as a lanyard can certainly be considered a worthwhile alternative to the traditional daisy chains and other personal restraint lanyards available in the marketplace.
DROP TESTING ON PURCELL PRUSIKS: A CRITICAL EVALUATION OF THEIR CAPABILITIES AS A POSITIONING LANYARD IN RESCUE AND CLIMBING
The same guys did a study on daisy chains as personal anchors and they broke at much lower fall factors.