Skip to main content
Solved

Datetime_diff need formula to return value as Days, Hours, Minutes

  • July 11, 2019
  • 8 replies
  • 57 views

Forum|alt.badge.img+12

Hello Friends,

Needing to use datetime_diff to return days, hours, and minutes. I can only get the days to return the value. Tried all different types of formula nothing is working. Any thoughts?



Best answer by CottageKeeper

Hi Kamille - wondering if you could help me figure out how to use the formula you provided above but when the Date Sold/Ended and Date Listed fields are empty to not have it show the #Error. Many thanks in advance! :pray:


Well I figured it out!

IF({Date Sold/Ended}=0,BLANK(), DATETIME_DIFF({Date Sold/Ended},{Date Listed},‘d’)&’ d(s), ‘&MOD(DATETIME_DIFF({Date Sold/Ended},{Date Listed},‘hours’),24)&’ h(s), ‘&MOD(DATETIME_DIFF({Date Sold/Ended},{Date Listed},‘m’),60)&’ m(s)’)

8 replies

Kamille_Parks11
Forum|alt.badge.img+27

Try:
DATETIME_DIFF({date end},{date start},'days')&' days '&MOD(DATETIME_DIFF({date end},{date start},'hours'),24)&' hours '&MOD(DATETIME_DIFF({date end},{date start},'minutes'),60)&' minutes'


Forum|alt.badge.img+12
  • Author
  • Inspiring
  • July 13, 2019

Try:
DATETIME_DIFF({date end},{date start},'days')&' days '&MOD(DATETIME_DIFF({date end},{date start},'hours'),24)&' hours '&MOD(DATETIME_DIFF({date end},{date start},'minutes'),60)&' minutes'


Hi Kamille, I can’t thank you enough! You’re brilliant! A thousand thank you’s! I hope one day I can be as smart as you are. :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :winking_face:


Kamille_Parks11
Forum|alt.badge.img+27

Hi Kamille, I can’t thank you enough! You’re brilliant! A thousand thank you’s! I hope one day I can be as smart as you are. :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :winking_face:


It’s all practice. I just use Airtable a lot haha


  • Participating Frequently
  • July 29, 2019

I want to do something similar but only looking at the how many days lost.


Kamille_Parks11
Forum|alt.badge.img+27

I want to do something similar but only looking at the how many days lost.


@Elaine_Winter then all you need is the first part of the formula.


  • Participating Frequently
  • July 29, 2019

@Elaine_Winter then all you need is the first part of the formula.


Thanks! I had been struggling a lot with that.


Forum|alt.badge.img+12
  • Author
  • Inspiring
  • January 21, 2021

Hi Kamille - wondering if you could help me figure out how to use the formula you provided above but when the Date Sold/Ended and Date Listed fields are empty to not have it show the #Error. Many thanks in advance! :pray:


Forum|alt.badge.img+12
  • Author
  • Inspiring
  • Answer
  • January 21, 2021

Hi Kamille - wondering if you could help me figure out how to use the formula you provided above but when the Date Sold/Ended and Date Listed fields are empty to not have it show the #Error. Many thanks in advance! :pray:


Well I figured it out!

IF({Date Sold/Ended}=0,BLANK(), DATETIME_DIFF({Date Sold/Ended},{Date Listed},‘d’)&’ d(s), ‘&MOD(DATETIME_DIFF({Date Sold/Ended},{Date Listed},‘hours’),24)&’ h(s), ‘&MOD(DATETIME_DIFF({Date Sold/Ended},{Date Listed},‘m’),60)&’ m(s)’)