Matrix utils for setting ranges