Applying function in Calc

Hi all,

How to make function that calculate time difference from col A and B and automatically the result is shown in col C
function I used is: =(Bn<An)+Bn-An, where n is number of row.
The problem is, that function must be applied manually each time I want the result / time difference /

Start in C1 with:

=B1-A1+(B1<A1)

and simply pull down.