The real trick is not buying prepared foods at all. Things like flour, rice, eggs, beans, pasta, potatoes, fresh fruit and vegetables, milk, yogurt, cheese, ground beef, fish filets and chicken breasts are all reasonably cheap and you can have a lot of variety with a relatively small set of ingredients on hand. With some practice you get to where you know how to parallelize the cooking steps so that you can get everything done and even cleaned up faster than you could run out for fast-food.
Secretly I want our next office to have a full kitchen since one of the things I miss when I'm at our office is being able to cook in the middle of the day.