I have a Google Sheets with start (C) and end (D) timestamps. I am calculating the time difference using =(D1-C1)
. I have copied the formula to empty columns which returns a 0 time difference.
Is there a way to hide the value if it returns 0?
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityThe following formula will do just that:
=IF(D1-C1=0;"";D1-C1)
It says: if the result of D1-C1 equals 0, then show nothing (""), else show the result.
=IF(D1>0;IF(D1-C1=0;"";D1-C1);"")
so that it will only display a difference if the End time stamp has a value.
Hiding 0
may be easier with formatting:
[=0];[HH]:mm:ss
Or you might consider a further step, which would be to blank out where you have a C
value but not (yet?) a D
one:
[HH]:mm:ss;;
In both cases where a result is shown it is displayed as hours:minutes:seconds (but may be adjusted).