Date / Time Replaced and Difference

Brass Contributor

I have the following sheet, with 'InTime' (Column D), 'OutTime' (Column E), and 'WaitTime' (Column F). 

All three columns are formatted as DateTime (Short date).

There are no blanks in 'InTime'. There are blanks in 'OutTime'.

How do I write a formula that says if 'OutTime' is blank place the content of 'InTime' in 'OutTime' but if 'OutTime' is not blank do nothing (leave the original date content); Then a formula that tells me the difference of 'OutTime' minus 'InTime'?

Phishdawg_0-1680563446949.png

 

1 Reply

@Phishdawg 

To place the content of ‘InTime’ in ‘OutTime’ if ‘OutTime’ is blank, you can use the following formula in cell E2: =IF(ISBLANK(D2),C2,D2)

This formula checks if cell D2 is blank using the ISBLANK function. If it is blank, it places the content of cell C2 in cell D2, otherwise it leaves the original date content.

 

To calculate the difference between ‘OutTime’ and ‘InTime’, you can use the following formula in cell F2: =E2-C2

This formula subtracts the value in cell C2 from the value in cell E2 to calculate the difference between them.

 

I hope this helps!