[RPG] How does the Sleep spell interact with undead

dnd-5ehit-pointssleepspellsundead

The sleep spell description (PHB, page 276) says to roll 5d8 to determine the total HP of creatures that can be affected, starting from the lowest hit points. Undead and creatures immune to charm are not affected by this spell.

Assuming I have a human wizard with 20 health, a zombie rat with 5 health, and a sleep spell roll of 20 hitting both. Does the undead rat's health pool interact with the total sleep pool, thus saving the wizard from sleep, or is the word "affected" meant to include both the spell is unaffected along with immune subjects?

I already understand the undead rat will not be put to sleep either way. I just wish to be clear if the undead would put a buffer of sleep hp of the wizard or not.

By comparison, the spell color spray with similar mechanics goes out of its way to say you ignore targets that already can't see. Whereas sleep only states ignore unconscious.

Best Answer

Sleep ignores undead creatures as well as creatures immune to being charmed

Quotes from Sleep, PHB p.276:

Creatures within 20 feet of a point you choose within range are affected in ascending order of their current hit points (ignoring unconscious creatures).

[...]

Undead and creatures immune to being charmed aren't affected by this spell.

Sleep states that creatures within the range are affected, but also states undead aren't affected. Specific beats general so you ignore the undead.

Mike Mearls supports this interpretation:

Radim Havlíček @Tavicz
@mikemearls Spell sleep: If the creature with the lowest current HPs has imunity to sleep, are its HPs subtracted from the total?
12:30 AM - 24 Mar 2015

Mike Mearls @mikemearls
@Tavicz no, just skip it and move to the next
5:20 PM - 25 Mar 2015