In this Salesforce Tutorial, we will learn the MIN() Function in Salesforce and also learn how to calculate the minimum value from the list of numbers or fields in Salesforce.
In addition, we will learn the syntax and some of the practical industrial use cases of the MIN() Function.
I recently started working for a US-based IT company that manages its client relationships using the robust “Salesforce” system. I was given the assignment to determine the minimum age of the contact.
As a solution, I discovered that Salesforce gives us the function named “MIN() Function” which is used to calculate the minimum value of the field.
Let’s proceed and see how to use the MIN() function in Salesforce Lightning and Salesforce Classic to determine the minimum value of the numeric data.
What is MIN() Function in Salesforce
The MIN() Function is one of the math aggregate functions available in Salesforce that may be used to perform mathematical calculations. Using Salesforce MIN() function we can determine the smallest or lowest possible value from the list of the values.
The MIN() function syntax is as follows:
MIN(number/field/formula)
The MIN() function value may be represented by a fixed list of numbers, fields, or complex formulas as the parameter value.
Additionally, only numerical data types like Numbers, Decimals, and Currency are supported by the MIN() function. And it will give us an error if we try to utilize text, dates, or any other non-numeric data types.
Let’s now look at an illustration that clarifies the idea and syntax of the MIN() function.
Let’s say we want to know how many orders can be registered at least. I use Salesforce’s MIN() function for this, and the formula is as follows:
MIN(Minimum_Orders__c)
With the help of this, we learned the MIN() function syntax, explanation, and demonstration. See how to use Salesforce Lightning to determine the lowest number from a list of numbers in the next section.
Calculate minimum value in Salesforce Lightning
Here, are the steps to find out the minimum value of the field in Salesforce Lightning:
Step 1: Log in to Salesforce Lightning mode, then click the “Gear Icon” in the top right corner of the page. Click “Setup” from the dropdown menu to continue.

Step 2: From the left side of the menu, click on “Object Manager”.

Step 3: Search for the object in the search bar where we wish to utilize the MIN() function. In this case, I search for the “Order” object as I want to track the minimum shipping charges of the product.
Step 4: Now, click on the “Order” object and it will redirect us to the order page.

Step 5: From the left side of the page click on the “Field & Relationship” option.
Step 6: Click on the “New” button to create a new field where we can use the MIN() function.

Step 7: It will redirect to the “Choose the field type” page, now check the radio button in front of the “Formula” data type.
Step 8: To proceed to the next step, click on the “Next” button.

Step 9: Enter the “Field Label” for the formula and the unique “Field Name” will be automatically populated. In this case, I entered the field label named “Minimum Shipping Charges”.
Step 10: Choose the “Data Type” for the field for which we want to calculate the minimum shipping charges of the order.
Here, I select the data type as “Currency” to get the formula return type as a price value, so I check the radio button in front of it.
Step 11: Move to the next step by clicking on the “Next” button.

Step 12: Move to the advanced formula editor, and enter the formula that uses the MIN() function. In this case, I want to calculate the minimum shipping price of the order using the MIN() function. Here, is the formula:
MIN(Shipping_Price__c, 100)
- In this formula, we pass the shipping price of the order field “Shipping_Price__c” as the first value of the list to the MIN() function. Next, we also pass the 100 to the MIN() function as the second value of the list.
- The function selects the minimum value from the list of the passed values and set it as the “Minimum Shipping Charges”.
Step 13: Click on the “Check Syntax” button to validate the formula and to ensure that there is no error.
Step 14: Optionally, we can “Handle the empty field” as well as we can define the “Description” and “Help text” if we want.
Step 15: Click on the “Next” button to move to the formula field-level security step.

Step 16: Select the relevant “Field Level Security”. In this case, I have checked the “Visible” checkbox as I want it to be visible to all the profiles. Then, to proceed click on the “Next” button.

Step 17: Now, select the appropriate “Page Layout” where we want to be visible.
Step 18: Click on the “Save” button to save the formula field.

We can use the formula field once we’ve created it. Let’s look at an example:
- Open the Orders Tab and create a new order with the field “Shipping Charges”.
- After saving, it will redirect to the Details Section and here the “Minimum Shipping Charges” field appears which shows you the result of the MIN() function.’

As a result, we now know how to calculate the minimum value of a field in Salesforce Lightning. Now, we’ll look at how to calculate the minimum value of a field in Salesforce Classic.
Read MCEILING() Function in Salesforce
Calculate minimum value in Salesforce Classic
Here, are the steps to find out the minimum value of the field in Salesforce Classic:
Step 1: From the Salesforce Lightning to open your Salesforce Classic edition. Click on Avtar and then click Switch to Salesforce Classic.

Step 2: After that, click on the Setup option.

Step 3: Now, scroll down to the Build section. Then under Customize, select the object for whom field we want to use the MIN() function. In this case, I select the “Leads” object as I want to find out the minimum number of days to convert leads.
Step 4: Click on the “Leads” dropdown and select the “Fields” option to get the option of the new field.

Step 5: Now scroll down to the “Lead Custom Fields & Relationships” and click on the “New” button to create a new formula field.

Step 6: It will redirect to the “Choose the field type” page, now check the radio button in front of the “Formula” data type.
Step 7: To proceed to the next step, click on the “Next” button.

Step 8: Enter the “Field Label” for the formula, and the distinct “Field Name” will be immediately filled out. In this example, I entered “Minimum Lead Conversion” as a field label.
Step 9: Choose the “Data Type” for the field for which the minimum value is to be determined. As I want to get the minimum value of lead conversion, I selected the “Numbers” as the formula return type by checking the radio button next to it.
Step 10: Click the “Next” button to move to the next step.

Step 11: Now, it will navigate to the advanced formula editor. Type the formula that computes the minimum value from the list using the MIN() function.
In this instance, I want to use the MIN() function to determine the minimum lead conversion rate. The formula is as follows:
MIN(Days_Convert__c)
In this formula, we pass the days convert of the lead field “Days_Convert__c” as the value of the list to the MIN() function.
Step 12: Tap “Check Syntax” to review the formula and ensure there are no errors.
Step 13: Define the “Description” and “Help text” as well as “Handle the empty field” if you would like.
Step 14: Click “Next” to proceed to the following step.

Step 15: Choose the appropriate “Level Security” for the profiles. As I want it to be visible to every profile, I have checked the checkbox next to “Visible” in this instance.
Step 16: Click on the “Next” button to move to the final step.

Step 17: Next, choose the suitable “Page Layout” for the field where we want to display this field.
Step 18: In order to save the formula field, click the “Save” button at the end.

We can use the formula field once we have created it. Let’s look at an example and understand how its works.
- Open the “Leads” item and create a new lead with the field “Days Convert” and then save it.
- After saving, it will redirect to the Leads Page, and here the “Minimum Lead Conversion” field appears which shows the result of the MIN() function.

As a result, we now know how to calculate the minimum value of a field in Salesforce Classic.
Conclusion
With this, we have concluded that the MIN() Function in Salesforce is a great and efficient way to find out the minimum value from the list. In addition, we focused on the syntax and various real-world business-related examples of the MIN() Function.
Furthermore, we covered the process of calculating minimum value using the MIN() Function in Salesforce Lightning and in Salesforce Classic step by step.
You may like to read:
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.