Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

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

Topic Labels: Formulas
246 2
cancel
Showing results for 
Search instead for 
Did you mean: 

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!