Help

Calculate days within date range, but returning a 1 if start and end is the same date

Topic Labels: Formulas
1172 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Kristine_Guzman
4 - Data Explorer
4 - Data Explorer

Hi Everyone, I’m trying to figure out a formula and am wondering if anyone here might know the answer:

I’m trying to calculate the days between a Start Date and End Date, but if the Start and End Date is the same, I want that to = 1.

I’m using the DATETIME_DIFF formula, but when the Start/End is the same, it returns a 0 when I want a 1.

Thank you!

2 Replies 2
IF(
   AND({Start Date}, {End Date}),
   IF(
      {Start Date} = {End Date},
      1,
      DATETIME_DIFF({End Date}, {Start Date}, 'days')
   )
)

Welcome to the community, @Kristine_Guzman! :grinning_face_with_big_eyes: Did the reply from @Kamille_Parks answer your question? If so, please mark her comment above as the solution to your question. This helps others who may be searching with similar questions. Thanks!