It's difficult because few references in the narrative within your file actually tie out to the actual cell references in use, nor do you outline expected results so it's hard to follow the logic.

On an aside, your existing formula in U4 can be simplified somewhat to:

=(MIN(G4,TODAY())-MAX(F4,Q4))/7
copied down

Perhaps worth posting a replacement file with corrected references and expected results (calculated manually of course)