This is what I have written so far, and it seems to be working!
=IF(AND(Q$1+6>=$P3, $A$1+6>=$P3, $A$1>=Q$1), $H3, IF($P3<Q$1,0,IF($P3<=Q$1+6,$H3,0)))
I just want to make sure my logic behind that makes sense, but it seems that I have made some really big progress if not, solved my own problem.