Offsetting and cropping from atlas in material

Im working on a map system, and have each room on it its part of an atlas.I have the original position (where the piece should go) and the atlas position, i can mask the part but i cant offset the result Since the result is a float i cant connect it in to the texture sample node, so how am i supposed to offset it to the correct position?