How do I test for a mob, with a given name, in a certain location?

Solution 1:

The x, y, and z parameters only change the origin of the search. To check for targets within a certain range of that origin, you will need to use selection limiters like r (radius, number of blocks in each direction from the origin to find a target):

/testfor @e[x=999,y=80,z=-1034,r=1,type=Sheep,name=Lamb]