Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Adding "Day" Type Duration to "Hour" Type Duration

Topic Labels: Dates & Timezones Formulas
Solved
Jump to Solution
700 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Lycka
4 - Data Explorer
4 - Data Explorer

I have a date+time and a duration (days: hours: minutes). I want to add a day:hour:minute duration to the date+time and output a new date+time. Issues I've encountered:

1. I can only set a duration field to be day OR hours/minutes/seconds. 

2. When attempting to create a formula to add a "Day" duration field to a "Hour" duration field the output is incorrect. For example I have a Day Duration field with "1" and in the Hour duration field I have 00:05. I tried

DATEADD({Next Output Days},{Next Output HH:SS},'seconds')   Results in #ERROR!
SUM({Next Output Days}+{Next Output HH:SS})   Results in 301?

I'd be fine with a result of the total seconds of the day + hours/minutes to use for my final formula but I can't seem to combine the day duration field and the hour/minute duration field into anything useable. 

I just want to recreate the function of this form under "Add or subtract time from a date" 
https://www.calculator.net/time-calculator.html?today2=07%2F31%2F2024&today2hour=6&today2min=15&toda...

I thought this would be more simple than it is. Any help would be appreciated.
1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, I think you're going to need to have one field for days and one field for hours/minutes/seconds I'm afraid

DATEADD(
  DATEADD(
    Date,
    Days,
    'days'
  ),
  {Hours/Minutes/Seconds},
  'seconds'
)

Screenshot 2024-08-02 at 9.28.48 AM.png

Link to base

See Solution in Thread

2 Replies 2
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, I think you're going to need to have one field for days and one field for hours/minutes/seconds I'm afraid

DATEADD(
  DATEADD(
    Date,
    Days,
    'days'
  ),
  {Hours/Minutes/Seconds},
  'seconds'
)

Screenshot 2024-08-02 at 9.28.48 AM.png

Link to base

Thank you! This is perfect. It worked exactly as I needed.