Try this:
In the first cell of your C column that has potential values in the B column (let's say that is row 12), use the formula
=if(B12, $G$2-B12, "")
This says, "if B12 contains a value use the formula $G$2-B12 to calculate a value for the cell, other wise assign the value "" (null) to the cell."
Copy this formula down the C column.
Does that produce the desired result?