0

I have a field that is common to several different record types, but the way it is scored is different for each. I am looking for assistance on how to write a formula that populates the same field differently for all of the different scoring scenarios if possible.

Example: My field is called Current Ratio and it is associated with Record Type 1, Record Type 2, and Record Type 3. For RT 1, I need the formula to provide a score of '6' if the Current Ratio is > 3.00. For RT 2, I need the formula to provide a score of '6' if the Current Ratio is > 2.50. For RT 3, I need a score of '6' if the Current Ratio is > 2.00.

The formula below works as is but does not include the Record Types, but can I include the RTs into this formula without having to create separate formulas for each?

IF( Current_Ratio__c > 3.00,6, IF( Current_Ratio__c >= 2.25,5, IF( Current_Ratio__c >= 1.75,4, IF( Current_Ratio__c >= 1.25,3, IF( Current_Ratio__c >= 1.00,2, IF( Current_Ratio__c <= 1.00,1, 0))))))

Thanks in advance for any assistance or feedback!

1
  • You should look into the CASE formula function.
    – Adrian Larson
    Commented May 27, 2015 at 18:52

1 Answer 1

0

Yes you can use the RecordType merge field for your object and include it in your formula. So the format would be <Your object>.RecordType.Name Use it with your existing IF statement or you can even use a CASE statement with your record type name.

Note: Use the RecordType name and dont use the RecordType Id. Your formula would take the form:

IF( Current_Ratio__c && <Your object>.RecordType.Name='RT1'> 3.00,6, IF( Current_Ratio__c && <Your object>.RecordType.Name='RT2'>= 2.25,5**............**
4
  • Thank you Richard! Pardon my possible ignorance as formulas aren't a strong suit, but when I mirror the formula you have above, I get an error message: Incorrect parameter type for operator '>'. Expected Text, received Number
    – brich1975
    Commented May 27, 2015 at 17:29
  • 1
    Take out the brackets...he just meant insert the object name in those places...they're being interpreted as greater than evaluators Commented May 27, 2015 at 17:58
  • Thanks @Brian Mansfield, I knew what he meant and did not include the brackets in my formula. Here is the formula that is producing the error. When I Check Syntax, it highlights the 3.00 for what it's worth. IF( Current_Ratio__c && RecordType.Name ='Commercial'> 3.00,6, IF( Current_Ratio__c && RecordType.Name ='CRE Non-Owner'>= 2.25,5 ))
    – brich1975
    Commented May 27, 2015 at 18:11
  • 1
    His answer was just giving you a general idea of how to approach it...it's not syntactically correct...the first condition in your initial IF statement is (Current_Ratio__c && RecordType.Name ='Commercial'> 3.00)....do you think that's doing exactly what you want it to do? I recommend reading about basic formula syntax, this is a pretty common use case and will be useful in the future Commented May 27, 2015 at 18:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .