Hello
Try replacing your formula in D3 down with the following:

=IF(A3="","",A3-B2)

Does this give the results you're looking for?