2

So I have two Date fields of type Date which will populate date using field updates by Workflows. Formula used - Today() // Note: I also tried using Now()

I have a third field formula field of Return Type Text IF(Date_1__c>CloseDate, TEXT( (ROUND( MOD ((CloseDate - Date_2__c)*24,24),0) )), TEXT( (ROUND( MOD ((CloseDate - Date_2__c)*24,24),0) ))) // I know I used same logic in the If-else; its just a test.

I needed the output in Hours. Note: I am receiving 0 as the output on the formula field

1 Answer 1

1

Use

(floor((CloseDate - Date_2__c)*24))
+
(((((CloseDate - Date_2__c)*24)-floor((CloseDate - Date_2__c)*24))*60)/100)

1st statement looks at # of hours only (ex: from 24.5 to 24). 2nd takes the amount, removes the hours (ex: 24.5 to .5), and convert the decimals to minutes (ex: .5 to 30).

4
  • So I used just the first statement since I only needed hours and on testing I got 408.00 as the output. Where Closed Date was 7/30/2015 and Date 2 was 7/13/2015
    – Sanjay
    Jul 13, 2015 at 18:25
  • Its correct, 17 days =408 hours, Do you need total hours or business hours? Jul 13, 2015 at 18:40
  • Exactly what output do you want? Jul 13, 2015 at 18:43
  • Sorry my bad! its good !
    – Sanjay
    Jul 13, 2015 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .