This question already has an answer here:
How much would someone absorb from the sleep spell if they can't be put to sleep? The spell states
This spell sends creatures into a magical slumber. Roll 5d8; the total is how many hit points of creatures this spell can affect. Creatures within 20 feet of a point you choose within range are affected in ascending order of their current hit points (ignoring unconscious creatures).
Starting with the creature that has the lowest current hit points, each creature affected by this spell falls unconscious until the spell ends. [...] Subtract each creature's hit points from the total before moving on to the creature with the next lowest hit points. A creature's hit points must be equal to or less than the remaining total for that creature to be affected.
So what happens if an elf or a warlock with Aspect of the Moon (both are immune to magical sleep but not directly to the spell itself) is in the targeted area?
A. Treat them like they don't exist
B. Subtract their HP and then move on, leaving them awake or
C. Let them absorb the full effect of the spell as regardless of their HP they can't be put to sleep
B seems the most likely but I feel like I've seen C ruled before in a game. A would also make some sense as well.