I am guessing one of your apparently "blank" cells referenced in the formula is not actually blank, but a single space or "", which is considered text, which will result in a #VALUE error when used in addition or subtraction. Change your formulas so the return 0 instead of a space or "" and it should work.
If you do not wish to see the zeroes, you can always hide them with Custom Formatting or Conditional Formatting.