Touch up painting can be tricky because of all the different variables that are involved. Will the color match? Will the sheen match? Will the the texture match? These are a few of the biggest challenges. In fact, in the commercial painting world we usually figure that you will have to paint from the nearest corner to corner whenever there is a touch up needed or else it won't blend in properly. Ceilings are even more of a challenge with today's open floor plans because often times they extend for a long distance before there is a break where you can stop.
If you have a spot on the ceiling that needs to be touched up there are a few things in your favor that may help keep you from repainting the entire ceiling. Most ceilings are painted with a flat sheen which helps hide the touch up. Another positive is most people don't look at the ceilings so you might be able to live with a close match that wouldn't otherwise pass on the walls. Most ceilings are a white color but there are thousands of shades of white and figuring out the correct shade can be frustrating. The best way to get an exact match is to cut a small piece of the paint off the ceiling to take into the store for an exact color match. It can be as small as the size of a quarter. You might want to do this in a closet or utility room where it won't be so noticeable. After you get it matched you can patch the small area and touch it up. If all your ceilings are the same color you will only have to do this once.
If you are unable to get a sample there is still an option you can try to improve your chance at success. A lot of times the ceilings are just a shade darker than true white. Painters often have a shot of black added to the flat white paint for the ceilings. If you don't know the color and can't get an exact color match I would try having an ounce of black added to a gallon of flat white at the paint store. This might get you close enough that it won't be noticeable to anyone that isn't looking for it.