Home > Mobile >  datedif formula -how to create a 0 Days result if the time between the cells is zero?
datedif formula -how to create a 0 Days result if the time between the cells is zero?

Time:07-11

I'm looking for one heck of a complicated formula!

I'm counting the years, months, and days between two cells in Google Sheets.

In the first row in the image below I'm counting the years, months, and days between column C and column D. In the second row, I'm doing the same, but I also need to add that if the result is zero days then the output/answer should just be 0 Days. How do I do that?

This is the formula I've used so far to get what you see in the image.

=datedif($C3,$D3,"y")&" Yr "&datedif($C3,$D3,"ym")&" Mths "&datedif($C3,$D3,"md")&" Days"

enter image description here

  • Related