Well, the first thing I need to mention is Item 3 from the Forum Guidelines:
I understand this is most likely related to a class at work, but I think it probably still applies.
The next thing is, in reviewing your setup, I think you may be seeing some unintended results. Your formulas in E39:E42 reference the Gross Wages in D2 (and D3). I don't think this is what you want, as the formulas will then always be based on those wages. If you can perhaps explain a bit more broadly the end goal, and especially how the math should work, we should be able to help get you there