There are MANY ways to do this, but I would do it as two sums added together....
Assuming you had the data you supplied in your question in cells A1 to B6, your formula could look as follows:
=SUMIF(B1:B6,"",A1:A6)+SUM(B1:B6)
In essence, you're saying:
- Sum A1:A6 anywhere B1:B6 is blank
PLUS
- Sum B1:B6
Hope this makes sense and helps!