-1

For EX: i have start date and end date , if i give start date 1/11/2016 and End date as 15/12/2016 then formula field should display 1.15 which means 1 month 15 days

closed as off-topic by Adrian Larson, Eric, Ratan Paul, Mohith Shrivastava, Lance Shi Dec 5 '16 at 1:05

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – Adrian Larson, Eric, Ratan Paul, Mohith Shrivastava, Lance Shi
If this question can be reworded to fit the rules in the help center, please edit the question.

  • how come .15 means 15 days? – Santanu Boral Dec 2 '16 at 18:20
  • yes your correct 15 days – Prasanth Dec 2 '16 at 19:12
0
TEXT(MONTH(end_date__c)-MONTH(start_date__c)) + '.' + TEXT(DAY(end_date__c)+1-day(start_date__c))

You'd also want to throw some if statements to handle 0's, blanks, put some validation rules in to make sure end date is after start date, etc. but that's the general gist of it.

  • Thanks above answer works fine but small correction – Prasanth Dec 2 '16 at 18:57
  • Text(MONTH( DATEVALUE( hi1__Enddate__c) )-MONTH( DATEVALUE(hi1__Start_date__c ))) + '.' + Text(DAY( DATEVALUE(hi1__Enddate__c ))+1-day( DATEVALUE(hi1__Start_date__c) )) – Prasanth Dec 2 '16 at 18:57
  • Why are you storing your dates as strings... – caleb.breckon Dec 5 '16 at 17:46
0

Text(MONTH( DATEVALUE( hi1__Enddate__c) )-MONTH( DATEVALUE(hi1__Start_date__c ))) + '.' + Text(DAY( DATEVALUE(hi1__Enddate__c ))+1-day( DATEVALUE(hi1__Start_date__c) ))

Not the answer you're looking for? Browse other questions tagged or ask your own question.