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
gstocktongstockton 

Scoring an account based on number of employees

I'm having trouble getting If function to calculate correctly.

IF( NumberOfEmployees > 5000, 5,0)

I want it to be 6 if number of employees is greater than 10,000. Can't get the syntax to work. It keeps finding errors in my code if I add a second If it tells me to remove it, or missing ), The single clause above will work, but I would like to add other scoring criteria like specific industry types, If Industry "Healthcare", 7,0

Would appreciate help.

Ron WildRon Wild
I used this formula to return a score based on several ranges of values for annual revenue.

Just substitute the Employees field label and values and you should be good to go.

IF( AnnualRevenue > 20000000  , 1,
 IF(AnnualRevenue > 10000000  , 0.75,  
  IF(AnnualRevenue > 5000000  , 0.50,  
   IF(AnnualRevenue > 2500000  , 0.25,  
    IF(AnnualRevenue > 1000000  , 0.1,  0
    )
   )
  )
 )
)
gstocktongstockton
Thank you, that worked for me. Cheers
miss vmiss v

Can this same formula be used in combination with text?  I'm trying to run a very simple IF formula that says is an Account name is X, then run this formula... but if it is not X, then run a different formula?  Here is sample of what I cannot get to work... can anyone help?

If (Account Name_c = "CPC", 1+1,

If (Account Name_c <> "CPC, 1+3, 0

 )

)

Harry JamesHarry James
If you are using the standard Account Name field, then the merge field name for a formula is simply Name.
miss vmiss v
I used the drop down for Insert Merge Field in the Advanced Formula section and it gave me "Account Name_c" as the field name option...  Should I change it to just Name?
Harry JamesHarry James
I am confused.  The "_c" appended to the field name indicates a custom field.  Have you created a custom field labeled "Account Name?"
miss vmiss v

It is a Account_c is a Master-Detail custom field that is pulled from the standard "Name" field.  It is pulled into custom object where i'm calculating the formula fields from.  I tried running the formula with both the Account_c="CPC" and the $Organization.Name ="CPC".  Neither works....  any suggestions on what I might be doing wrong?

I appreciate all the help... thanks!

Harry JamesHarry James
I see.  Someone may be able to provide a better alternative, but I believe that you won't be able to use the account name.  You would have to use the Account record ID.  That may be OK if you only have one or two accounts on the "true side" of your IF statement, but a pain if otherwise.
 
The one time that I had to do something like this, the formula was in the form of:
 
IF( Account__c = "00130000115" & "abcZ", 100, 50)