I have learned a lot from my sleeping (and lack thereof) experiences. For example, a lot of people aren't aware of this, but the ratio of awake time to sleep time is almost always 2:1. You can see this every day in the suggested 16 hours awake/8 hours asleep. This can also be extended to 18 hours awake/9 hours asleep and so forth. Using this knowledge, I wanted to figure out something: If I have been awake A hours and want to wake up B hours from now after a complete 2:1 sleep, in how many hours (Z) should I fall asleep? Well, after doing a small bit of math, I figured out a good formula for it. Here's a look at my work.

"Time from when I woke up until now" + "Time until I fall asleep" + "Time from when I fall asleep until I wake up" = "Time from when I woke up until now" + "Time from now until I wake up"
A + Z + (A + Z)/2 = A + B
2Z + (A + Z) = 2B
3Z = 2B - A
Z = (2B - A)/3
Thus, to figure out how long I must wait until I fall asleep, I multiply how long until I want to wake up by 2, then subtract how long I've been awake, then finally divide by three. If the number is negative, it is too late and if it is zero... SLEEP!!!
(Note: This assumes you had a full sleep and are fully awake by the time you first awake. Also, if you cannot make it, do not attempt it. If it is that long that you cannot make it, it's probably long enough to separate into two sleeps.)

Now for some examples:
Lets say I've been up since 2 pm yesterday and it is 9 am now and I want to wake up at 8 am tomorrow, when should I fall asleep (even if I could already right now). Well, I want to wake up in 23 hours and I've been up 19 hours already. Applying my formula, I should fall asleep in (46 - 19)/3, or 9 hours. That means I will have a total of 28 hours of being awake and 14 hours from 6 on (9 hours after 9AM) is 8AM. It works! My ratio is 28/14, or 2:1.
Now lets say I've been up since 6 am and it's now midnight and I need to wake up at 6 am with the correct ratio, is this possible? Well, (12 - 18)/3 < 0, so no, it isn't possible. If I fell asleep right now, my ratio would be 3:1, blegh.