Hello!
=IF(AND(D15>=$J26,D15<$J26+7),$G26,IF(D15>$J26,INDEX($H$38:$H$136,COLUMNS($D$16:D16)),0))
If the date D15 is within the range AND(D15>=$J26,D15<$J26+7), then fill the cell with $G26.
If the date D15 is outside the above range, and it is lower than $J26, then fill the cell with 0.
If the...