1

**In User Object, I have Created a one Custom Field Called Profile Calculation as a Formula Field and Return Type as Percentage

In user Object,if i fill firstName,LastName,Email,Title the Profile Calculated Custom Field Shows 40%,if i fill Country the profile Calculated Custom Field Shows 70%,Phone and Mobile it shows 100%,in User Object

How to Write Formula for this Using Formula Field**

  • Please Guide Me for the Anaswer – user30475 Apr 13 '16 at 11:23
  • Share formula code? – itzmukeshy7 Apr 13 '16 at 11:31
  • ((%lastname+%FirstName+%Email+%Title)40+(%country)30+(%phone+%Mobile)30)/100 – user30475 Apr 13 '16 at 11:34
  • It is Not Working ,Please Guide Me For the Answer – user30475 Apr 13 '16 at 11:35
  • @itzmukeshy please Guide Me for Answer – user30475 Apr 13 '16 at 11:35
0

Create a formula field of Percent type:

MIN(1,
 IF( OR(  ISNULL(FirstName),  ISNULL(LastName),  ISNULL(Email), ISNULL(Title) ), 0, 0.4) +
 IF( ISNULL(Country), 0, 0.3) +
 IF( OR(  ISNULL(Phone),  ISNULL(Mobile) ), 0, 0.3)
)

I've added MIN just in case if someone later will adjust the formula that max summary will go over a 100% to top at 100%. Also, if any field from each IF formula will be blank, 0% will be assigned for the group. If you want to assign 10% for each populated field from the first group, split it into a separate pieces like IF( ISNULL(FirstName), 0, 0.1)

  • @itzmukeshy hi if any one of the fields missing in first four(first name,Last Name,Email,Title),Remanining all fields are filled also,it should return 0% percent only,first four fields are filled,second expression are missing and third expressions are also filled it should return only 40%,1 and 2 expressions are filled ,it should return 70%,3 expressions are filled it should return 100% – user30475 Apr 18 '16 at 8:31
  • @Elavarasan I have already shared; and my implementation works for every field value as in first expression there are 4 fields if any one of them is filled then you will get the % for that field not 0; let say if FirstName is only field filled by user then you will get profile status 10% not 0%; What you say want to modify this as want to implement that same as per my answer; – itzmukeshy7 Apr 18 '16 at 9:09
  • @Elavarasan Mandatory 1 expression are filled,2 and 3 are also filled it should return 0 what do mean by this? – itzmukeshy7 Apr 18 '16 at 9:15
  • @Elavarasan You want to give full % if all the fields are filled right? – itzmukeshy7 Apr 18 '16 at 9:15
  • @Elavarasan (FirstName, LastName, Email,Title) 40% or 0% then (Country) 30% or 0% and (Phone, Mobile) 30% or 0% right? – itzmukeshy7 Apr 18 '16 at 9:27
0

Try this ;)

To do so you need to create more than one formula fields:

  1. Create a formula field for country like this IF(ISBLANK( MailingCountry ), 0, 30) and set return type as Number;

  2. Create a formula field for first name like this IF(ISBLANK( FirstName ), 0, 10) and set return type as Number;

  3. Create a formula field for last name like this IF(ISBLANK( LastName ), 0, 10) and set return type as Number;

  4. Create a formula field for email like this IF(ISBLANK( Email ), 0, 10) and set return type as Number;

  5. Create a formula field for title like this IF(ISBLANK( Title ), 0, 10) and set return type as Number;

  6. Create a formula field for country like this IF(ISBLANK( Phone ), (IF(ISBLANK( MobilePhone ), 0, 30)), (IF(ISBLANK( MobilePhone ), 15, 30))) and set return type as Number;

    Hide all the above 6 formula fields from all UI for all users. As we don't want's to show these to anyone these are just for calculation only;

  7. Now create final formula field which will be visible to users and write formual for this something likes this (Country_status__c + First_Name_status__c + Last_Name_status__c + Email_status__c + Title_status__c + Contact_Number_Status__c ) / 100;

That's it;

  • Try this tested with first two fields; let me know if you face any error; – itzmukeshy7 Apr 13 '16 at 12:24
  • Steps numbered now have a try; – itzmukeshy7 Apr 13 '16 at 12:31
  • For this you have to write if condition as i wrote for the last 2; – itzmukeshy7 Apr 13 '16 at 12:40
  • Please Guide for the Third Step – user30475 Apr 13 '16 at 12:41
  • Okay do let's do it in simple way for the all four fields create 4 formula same as coutry the first one with returning value of 0 OR 10; Got it; – itzmukeshy7 Apr 13 '16 at 12:48

Your Answer

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