Formula on g2 to drag down

If there is a sale either in oct nov or dec ( A B or C ) and stock ( E ) is zero , quote quantity to patch sum of A B C