Math question

Hello,

I have tried everything to make this work. I know there is an easy solution but it eludes me. I have 2 sliders (see pic) that has a number attached to each one. I have everything set up except for one thing. I need to get the numbers to adjust as you move the sliders up and down. For example, as you drag the top slider down towards the bottom slider, the number needs to decrease as it gets closer to the bottom slider. Once it hits the bottom slider, the top number should match the bottom number. And visa versa for the bottom slider, as it moves up the number increases and matches the top number when it hits the top slider. The min/max starting numbers will change (they come from XML).

Long story short, I need an equation that makes the numbers adjust within the range of the high/low number. Thanks so much for any help.