Skip to main content

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

  • July 15, 2021
  • 2 replies
  • 29 views

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

Kamille_Parks11
Forum|alt.badge.img+27
IF(
   AND({Start Date}, {End Date}),
   IF(
      {Start Date} = {End Date},
      1,
      DATETIME_DIFF({End Date}, {Start Date}, 'days')
   )
)

Justin_Barrett
Forum|alt.badge.img+21

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!