# ASIN() Function in Salesforce | Calculate inverse sine value in Salesforce

In this Salesforce tutorial, we will learn the ASIN() function and how we can use it to calculate the arc sine value of numerical data. In addition, we will also focus on its syntax and some practical examples.

While employed in a Sales Organization that uses Salesforce as a customer relationship management tool to track their sales. I got a task to calculate the performance of employee sales commission.

Here, I found an ASIN() function as a solution that helped me to calculate the performance metrics. Now, let us discuss in detail, how to use the ASIN() function to calculate the performance value of a number in Salesforce Lightning as well as Salesforce Classic.

## What is ASIN() function in Salesforce

In Salesforce, we have multiple functions that are used to perform mathematical calculations and the ASIN() function is one of the mathematical functions. Here, the ASIN() stands for “arc sine”.

To determine the inverse sine of an angle or value, use the ASIN() function. It is primarily utilized in Salesforce when trigonometric calculations are required or a radian value is required.

Additionally, it should be noted that the ASIN() function only works on numeric data types like Decimal, Integer, or Double. It will result in an error if you use it with other data kinds like text, dates, or other non-numeric data types.

### Syntax and Usage of Salesforce ASIN() function

Below is the syntax for the ASIN() function:

``ASIN(number/field/formula)``

The value for which we want to find the inverse sine is the number/field/formula parameter’s value. The parameter’s value can be a field, a constant number, or a formula.

To further understand the concept and syntax of the ASIN() method, let’s look at an example.

Assume that we want to determine the inverse sine value of the numeric field value “Employee Sales Commission” and that we will do so by using the ASIN() function. The formula reads as follows:

``Performance Score = 100 * ASIN((Avg Satisfaction- 3) / 2) / (PI() / 2)``

With this, we have adequate knowledge of the syntax, logic, and illustration of the ASIN() function. Moving forward, let’s try to figure out how to compute the inverse sine value in Salesforce Lightning.

## Calculate the inverse sine value in Salesforce Lightning

Here, are the steps to calculate the inverse sine value in Salesforce Lightning:

Step 1: Log in to Salesforce Lightning mode first, then click the “Gear Icon” in the top right corner of the page. Click “Setup” from the dropdown menu to continue.

Step 2: Select “Object Manager” from the menu’s left side.

Step 3: Use the search bar to look for the object you want to use with the ASIN() method. Since I want to keep track of the product demand, in this example, I look for the “Product” object.

Step 4: Now, click the “Product” object, and the product Page will be displayed.

Step 5: Select “Field and Relationship” from the menu on the left-hand side of the page.

Step 6: Press the “New” button to add a new formula field where the ASIN() function can be used.

Step 7: It will forward to the “Choose the field type” page; select the “Formula” data type by selecting the radio button next to it.

Step 8: Press the “Next” button to proceed.

Step 9: After entering the “Field Label” for the formula, the unique “Field Name” will be filled in automatically. I typed “Product Demand” into the field label in this instance.

Step 10: Select the “Data Type” for the field where the inverse sine value will be calculated. A numeric data type, such as “Number”, “Currency”, etc., must be indicated for the data type.

Here, I choose “Number” as the formula return type and click the radio button to the right of it.

Step 11: At this step, click the “Next” button to proceed to the next step.

Step 12: Enter the formula to compute the inverse sine value using the ASIN() function in the advanced formula editor.

I want to calculate the inverse sine of the product demand, in this case, using the ASIN() function. The formula is as follows:

``ASIN(Avg_Rating__c / 5) + ASIN(Units_Sold__c / 1000)) * 100 / (2 * PI())``
• The “Product Demand” is determined by the formula using the Average Rating and the number of Units Sold.
• The ASIN function is employed and before using the ASIN function, the Average Rating is divided by 5, and the number of Units Sold is divided by 1000.
• Following that, the calculated numbers are combined, multiplied by 100, then divided by the constant 2 times PI.

Step 13: To verify the formula and make sure there are no mistakes, click the “Check Syntax” option.

Step 14: Alternatively, we may define the “Description” and “Help text” as well as “Handle the empty field” if we like.

Step 15: To continue, press the “Next” button.

Step 16: Select the appropriate “Level Security” option. I have selected “Visible” in this case because I want it to be visible to everyone. Next, select “Next” from the menu.

Step 17: Following that, choose the “Page Layout” that will best display our content.

Step 18: In order to save the formula field, click the “Save” button.

Once we’ve set up the formula field, we may use it. Let’s examine an illustration:

• Create a new product with the fields “Avg Rating” and “Unit Sold” by opening the Product Tab.
• Click on the Details section after that, and the Product Demand field will display the ASIN() function’s output.

As a result, we now know how to calculate the inverse sine value in Salesforce Lightning. Now, we’ll look at how to calculate the inverse sine value in Salesforce Classic.

## Calculate the inverse sine value in Salesforce Classic

The steps to determine the inverse sine value in Salesforce Classic are as follows:

Step 1: Open your Salesforce Classic edition from Salesforce Lightning. Click on Avtar and then click Switch to Salesforce Classic.

Step 2: Next, select Setup from the menu.

Step 3: Next, go to the Build section by scrolling down. The object for whose field we want to use the ASIN() function should then be selected under Customise.

I choose the “Orders” object in this instance because I want to monitor the profit margin.

Step 4: To get the choice for the new field, click on the “Orders” dropdown and choose the “Fields” option.

Step 5: To add a new formula field, scroll down to “Custom Fields & Relationships” and select the “New” option.

Step 6: It will go to the “Choose the field type” page; select the “Formula” data type by selecting the radio button next to it.

Step 7: Press the “Next” button to move on to the next followed step.

Step 8: When you enter the “Field Label” for the formula, the unique “Field Name” will be automatically filled out. In this case, I typed “Profit Score” into the specified field.

Step 9: Choose the “Data Type” for the field where the inverse sine value will be calculated. A numeric data type, such as “Number”, “Currency”, etc., must be specified for the data type.

In this instance, I select “Number” as the formula return type by selecting the radio button next to it. The decimal place was adjusted to 2.

Step 10: At this step, select “Next” to move to the proceeding step 3.

Step 11: Go to the advanced formula editor and type the formula to compute the inverse sine value using the ASIN() function.

In this instance, I want to use the ASIN() function to determine the inverse sine value of product margin based on customer input. The formula is as follows:

``Satisfaction__c + 100 * ASIN(Profit_Margin__c / 100) / (PI() / 2)``
• The Product Score is determined by a formula based on Satisfaction and Profit Margin. The Satisfaction score is added directly to the formula.
• To normalize the value of the Profit Margin, it is divided by 100 and then put through the ASIN function. The result is then divided by the constant value of PI () divided by 2, and finally multiplied by 100.

Step 12: Select “Check Syntax” to review the formula and ensure there are no errors.

Step 13: If we’d like, we may specify the “Description” and “Help text” as well as “Handle the empty field”.

Step 14: To proceed, use the “Next” button.

Step 15: Choose the appropriate “Level Security” field. Because I want it to be visible to everyone, I have chosen “Visible” in this instance. Select “Next” to continue after that.

Step 16: Next, choose the suitable “Page Layout” for the area where we wish to display this field.

Step 17: In order to save the formula field, click the “Save” button.

Once we’ve established the formula field, we may use it. Let’s examine an illustration:

• Create a new order with the fields Satisfaction and Profit Margin by opening the Order tab.
• When we click Save, we are taken to the Detail page, where the Product Score field displays the ASIN() function’s output.