Loading
Prepare for Email to Become the Default Login ExperienceRead More
Ongoing maintenance for Salesforce HelpRead More
Extend Salesforce with Clicks, Not Code
MAX

MAX

Returns the highest number from a list of numbers.

Use

MAX(number, number,...) and replace number with the fields or expressions from which you want to retrieve the highest number.

Service Charge
Service Charge

MAX(0.06 * Total_Cost__c, Min_Service_Charge__c)

In this example, the formula field calculates a service charge of 6% of the total cost or a minimum service charge, whichever is greater. Note that Min Service Charge is a custom currency field with a default value of $15. However, you could make it a formula field if your minimum service charge is always the same amount.

Book Royalties Example
Book Royalties Example
MAX(0.10 * Pages__c, 
  (Retail_Price__c * 0.07) * Total_Sold__c)

This formula determines which amount to pay in royalties for a book. It displays the greater of two amounts: $0.07 for each book sold or $0.10 per page. It assumes you have custom number fields for Pages and Total Sold and a custom currency field for Retail Price.

Commissions Example
Commissions Example
MAX($User.Commission_Percent__c * Price,
  ​Price * Account_Discount__c, 100)

This formula determines what commission to log for an asset based on which is greater: the user's commission percentage of the price, the price times the discount percent stored for the account or 100 dollars. This example assumes you have two custom percent fields on users and assets.

 
Loading
Salesforce Help | Article