The idea is that I want to get a percentage of the position of Rect2 in relation to Rect1. In the picture, it would be about 75/80%. Rect2 never leaves Rect1. I move Rect1 around all the time, so it should work regardless of Rect1's position.
I had something like this, but it didn't work as intended: ((Rect2.X + Rect1.X) / (Rect1.Width + Rect1.X)) * 100
Rect1.X would work as an offset so the calculation would "ignore" the moving around of Rect1. Or that was the idea...