For purposes of determining which creatures are affected (read: targeted) by Sleep, only unconscious, undead, and constructs are ignored. Thus, any creature immune to the spell and is targeted essentially takes away the number of hit dice the spell can affect.
If the elf were not actually...