Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Date difference calculation when it is blank

Hi,

 

need help on data diff calculation when it is blank.

For row1, I am able to find difference using datediff function.

=datediff(date1,date4,day).

but for remaining rows, when it is blank I am not able to get expected result.

 

please help.

 

regionDate1Date2Date3Date4Result
A7/15/20218/1/20218/12/20218/16/2021days between 7/15 and 8/16
B7/14/20217/31/20218/15/2021 when date 4 blank, days between 7/14 and 8/15
C7/21/20217/26/2021  when date 3 is blank  days between 7/21 and 7/26
  • Anonymous , a new column

     

    datediff([date1], coalesce([Date4],[Date3], [Date2]), day)

2 Replies

  • Anonymous , a new column

     

    datediff([date1], coalesce([Date4],[Date3], [Date2]), day)

    • Anonymous's avatar
      Anonymous
      Not applicable

      Perfect. You made my day easy. Thank u so much. amitchandak