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
anil Kumaranil Kumar 

Formula field to calculate fields completeness

Hi All,

I need to create formula field to calculate fields completeness. Please help me on this.
 Name : 30%
 Email: 25%
 Phone: 25%
 Address: 10%
 DOB: 10%
Thanks,
Best Answer chosen by anil Kumar
ravi soniravi soni
Hi anil kumar,
please try following formula
 
IF( NOT(ISBLANK( LastName )),0.30, 0)+
IF( NOT(ISBLANK(Email)),0.25, 0) +
IF( NOT(ISBLANK(Phone)),0.25, 0) +
IF( NOT(ISBLANK( MailingAddress )),0.10, 0)+
IF( NOT(ISBLANK( Birthdate )),0.10, 0)

Please let me know, If it's help.

All Answers

sachinarorasfsachinarorasf
Hi anil Kumar,

Please Try this 

(If( Name , 30, 0)+ If( Email , 25, 0)+ If( Phone , 25, 0) + If( Address , 10, 0) + If( DOB, 10, 0))

Please find the below link for further reference.
https://developer.salesforce.com/forums/?id=9060G000000Xdn3QAC

I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com
anil Kumaranil Kumar
Hi Sachin,

Thank you for the responce. I have tried above formula with return type of Number and Percentage. I am getting beloe syntax erroe. 

Incorrect parameter type for function 'IF()'. Expected Boolean, received Text

Thanks,
ravi soniravi soni
Hi anil kumar,
please try following formula
 
IF( NOT(ISBLANK( LastName )),0.30, 0)+
IF( NOT(ISBLANK(Email)),0.25, 0) +
IF( NOT(ISBLANK(Phone)),0.25, 0) +
IF( NOT(ISBLANK( MailingAddress )),0.10, 0)+
IF( NOT(ISBLANK( Birthdate )),0.10, 0)

Please let me know, If it's help.
This was selected as the best answer
anil Kumaranil Kumar
Thank you Soni. This worked for me.