Another way:
Formula: copy to clipboard
=IF(E4=1,SUMIF(E$4:E4,1,E$4:E4),"")