I can propose you this formula:
[G2]=MIN([@[duration (weeks)]]*7,MAX(0,DATE(2026,1,1)-[@[start date]]))/7*[@[weekly cost]]