+ Start a Discussion
Andrew Hoban 6Andrew Hoban 6 

Concatonating formula Text field only if all fields are NOT blank

HI all,

I am trying to create a formula text field that will concatonate fileds only if all fields are not blank. At the minute my formula fields just puts them all together regardless of the field values.

Is this possible inside of Salesforce?

My current formula field
First_Name__c & "-" & Last_Name__c & "-" & City__c & "-" & State__c & "-" & Postal_Code__c & "-" & Address1__c & "-" & Mobile_Phone__c
Thanks
 
Best Answer chosen by Andrew Hoban 6
@anilbathula@@anilbathula@
Hi Andrew Hoban 6,

Try this formula:-
IF(AND(First_Name__c !='' , Last_Name__c!='' ,City__c !='', State__c !='',Postal_Code__c!='', Address1__c !='' ,Mobile_Phone__c!=''),First_Name__c & "-" & Last_Name__c & "-" & City__c & "-" & State__c & "-" & Postal_Code__c & "-" & Address1__c & "-" & Mobile_Phone__c,'')

Thanks
Anil.B