Recently, I was hired by a New York-based company that uses Salesforce CRM to manage its operations. I was given a job at work that required me to determine the overall amount of funds raised for the campaign.
As a solution, I discovered that Salesforce gives us the function named “MOD”, which helps in determining the remainder when a number is divided by a given divisor.
In this tutorial, we will learn about the MOD() function in Salesforce. In addition, we’ll learn the syntax and real-world Salesforce use cases for this function.
What is the MOD Function in Salesforce
The MOD() function in Salesforce is a mathematical function used to perform calculations. In basic terms, the MOD() function returns the remainder when a number is divided by a specified divisor.
Additionally, only numerical data types—Integers, Decimals, and Currency — are supported by the MOD() function. However, if you attempt to utilise a text, date, or other non-numeric data type, an error will result.
The Salesforce MOD() function syntax is as follows:
MOD(dividend, divisor)
Here, the divisor is the number by which the dividend is divided, and the dividend is the number that is being divided. The value of the parameter divided by the divisor can be a field, a constant number, or a complex formula.
To better understand how the MOD function works, let’s look at an example.
As I mentioned above, I need to figure out how much money the campaign raised overall. I will therefore utilise the Salesforce MOD() method for this. The formula is as follows:
MOD(Total_Contribution__c, Total_Amount__c)
With this, we learned the syntax of the MOD() function as well as an example. We’ll now look at how to use the MOD() function in Salesforce.
MOD() Function in Salesforce: Calculate Remainder in Salesforce
The steps to use the MOD() function in Salesforce are as follows:
- Log in to Salesforce org, then click the “Gear Icon” in the top right corner of the page. To proceed, click “Setup“ from the dropdown menu.

- The “Object Manager” is found in the Navigation Bar next to the Home tab. Click on it.

- The object manager page opens when you click it. Now, click the “Campaign” object to move to the campaign object page.
