How can I create a conditional subrange?