Forum Discussion
Date / Time Replaced and Difference
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'?
- NikolinoDEGold Contributor
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!