# Do Basic Math with Formulas

When we design a datasheet, we need to use basic addition, subtraction, multiplication and division operations in many cases. How to make two fields of data perform simple operations in the AITable?How to perform mixed operations on multi-field data?This article will describe in detail.

## Addition

For example: We design an "Order Management" datasheet, and the sales of products in two sales channels are "7-ELEVEN" and "LAWSON".If you want to count the sum of two sales, the formula in the "Sales Statistics" field is written as: `{7-ELEVEN} + {LAWSON}`

## Subtraction

For example: In the "Product Inventory" datasheet, the "Purchase Record" field is the total number of items, and the "Sales Order" field is the number sold. If we want to calculate the inventory of an item, then the formula in the "Inventory" field is written as: `{Purchase Record} - {Sales Order}`

## Multiplication

For example: In the "Sales Orders" datasheet, we want to calculate the total revenue for each individual item, and the formula in the field "Revenue" is written as: `{Profit Per Product} * {Quantity}`

## Division

For example: In the "Product Inventory" datasheet, we want to calculate the gross profit margin of the product, the formula in the "gross profit margin" field is written as: `{Profit per product} / {Unit Price}`

## Mixed operations

In the above example, we only perform one operation every time we write a formula. In the actual operation process, we can complete multiple operations in one formula.Mathematical operations can use square brackets "()" to change the order of operations.

For example: In the "Order Management" datasheet, we want to calculate the gross profit of an order, and the formula in the "gross profit of an order" field is written as: `({7-ELEVEN} + {LAWSON}})*({Unit Price} – {Cost Price})`

## Output formatting

In the above example, we can find that the numerical value output in the mathematical operation is in numerical format in the "Sales Statistics" field, in the currency format in the "Order Gross Profit" field, and in the percentage format in the "Gross Profit Margin" field.

In fact, we can customize the format of the output value through the formula operation. The formats that can be selected are as follows:

- Number, supports setting precision
- Currency, supports setting currency symbol and precision
- Percentage, supports setting precision