function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
meghna nmeghna n 

formula field in LEAD object

I have a requirement to create a formula field as follows:

The formula field should be created on the LEAD object.

The formula field should evaluate the following 5 fields: Email, Phone, Company, Title, and Industry and return 0 if blank and 1 if not blank.
The formula should then add all the values together to return a total value.

Please let me know how to do this?

thanks 
meghna
Best Answer chosen by meghna n
Khan AnasKhan Anas (Salesforce Developers) 
Please change the Formula Return Type as Number.

User-added image

User-added image

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Meghna,

Greetings to you!

Please try below formula:
IF(ISBLANK(Email) , 0, 1) + 
IF(ISBLANK(Phone) , 0, 1) + 
IF(ISBLANK(Company) , 0, 1) + 
IF(ISBLANK(Title) , 0, 1) + 
IF(ISPICKVAL(Industry , ""), 0, 1)

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
meghna nmeghna n
Hi Khan

I am getting an error as
" Error: Formula result is data type (Number), incompatible with expected data type (true or false)."

 
Khan AnasKhan Anas (Salesforce Developers) 
Please change the Formula Return Type as Number.

User-added image

User-added image
This was selected as the best answer
meghna nmeghna n
This worked.  thank you