Not sure why mob_dead doesn't work for you.
I was going to suggest foreachinrange, but that applies a function. now there is another function called map_count_oncell (called by map->count_oncell)
Example code Under the assumption of a rectangular range & positive range value: