If it’s returning zero all the way down, be sure the ISBLANK part of the formula is truly looking at a column that should be empty or not. Also the IF statement should be within the Arrayformula. Not outside of it. And change ‘D2’ to ‘D2:D’ because you want to look at a range of cells. Not just cell D2.
Arrayformulas should use a range of cells, so also change ‘D2+E2’ to ‘D2:D+E2:E’
If you are putting the formula in the second row, then us this:
If putting in row 1 along with the heading, then use this:
If you still have issues, overwrite any double quotes. Sometimes they copy weird from the forum. Also, depending on the regional locale of the sheet, some countries swap commas and semicolons.