There is a node that does that. It takes two ranges and a value. I forgot what its called and was trying to find it myself.