---
schema_version: "1"
id: c3b73ca23dd1dc43133465d31d46b521448c5ff1fca2f1a8d7ab74b1059cb020
title: MAX
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_max.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_max.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b3e09213a2443d7b9562c854a24181b26c54d85d2d1df14fa265d948a35ea841
description: Returns the highest number from a list of numbers.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# 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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

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](https://help.salesforce.com/s/articleView?id=platform.fields_about_default_field_values.htm&release=264.0.0&type=5 "Prepopulate field values with defaults to save your users time and improve consistency. Default field values make your users more productive by reducing the number of fields they must fill in manually.") of $15. However, you could make it a formula field if your minimum service charge is always the same amount.

![Book Royalties Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

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.