1

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?

2

The 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.

  • 1
    Thanks. I extended the formula to =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. – xylar Jan 2 '13 at 11:44
0

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.