Hello. I have this formula in about 1200 cells.

=IF(B9<>"",SUMIF(GL!$A$1:$A$217000,$B9&"-"&C$4,GL!$D$1:$D$217000)-SUMIF(GL!$A$1:$A$217000,$B9&"-"&C$4,GL!$C:$C),"")

I would like to change this formula into this formula (format) below for all of the cells? How can I do that?

=SUMPRODUCT(--(GL!$A$2:$A$217000=B9&"-"&$C$4),(B9<>"")*(GL!$D$2:$D$217000-GL!$C$2:$C$217000))