I want to have a formula field that displayes the Start Date of an event to the End Date of an event, i.e (01/01/2017 - 31/12/17) - Like this

But when I try to make it like this I can't as the dash gets read as text and it creates a syntaxt error. When I make the formula text, the field looks like this : 2017-01-01 - 2017-12-31

Is it possible to get the format I want, if so could I get help with the formula?


You need to ensure your formula return type is text.

You can use the DAY(), MONTH() and YEAR() functions wrapped in a TEXT() method to build the format you want, concatenating "-" and "/" characters where appropriate:

TEXT(DAY(Start__c)) & "/" & TEXT(MONTH(Start__c)) & "/" & TEXT(YEAR(Start__c))
& " - " &
TEXT(DAY(End__c)) & "/" & TEXT(MONTH(End__c)) & "/" & TEXT(YEAR(End__c))

Something like the above should work.

  • You're an absolute legend, mate
    – Alex
    Jun 26 '17 at 12:57
  • @Alex Happy to help! :)
    – Dan Jones
    Jun 26 '17 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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