> For the complete documentation index, see [llms.txt](https://alt-team.gitbook.io/product-price-calculator-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alt-team.gitbook.io/product-price-calculator-en/usage/work-with-functionality/how-to-create-a-formula-that-will-work-with-options.md).

# How to create a formula that will work with options?

Product price calculator works correctly with options. It allows to add options on base of entered dimensions.

For example, you sell a table board, it has such options as a Top material (Oak, Birch, etc) and a Color (White, Black, etc.). Top material price depends on a price per a square meter. Color price is a fixed price that will be added to the final product price.

Let's see the formula example for this situation (initial price is per a square meter):

<figure><img src="https://content.gitbook.com/content/iN5rELM2bxv9vM9gRht9/blobs/gqrbsEiChbqE6aCS7eUL/iVJ9WcZxv.png" alt=""><figcaption></figcaption></figure>

Once you have created the options for a product in the admin back-end, option values how they should be used in a formula appear in the Options section as it is shown on the screenshot above.

**Formula explanation:**

\[val\_1] is the value for the dimension Name with Position 1;

\[val\_2] is the value for the dimension Name with Position 2;

\[opt\_26] is the id value of the created Table top material option. Remember, in our example, this option has price modifiers that depend on a price per a square meter.

\[opt\_1] is the id value of the created Color option. Remember, in our example, this option has price modifiers that are fixed and should be added to the final product price.

\[price] is the price per a square meter.

**The formula looks as follows:**&#x20;

\[val\_1]\*\[val\_2]\*(\[opt\_26]+\[price])+\[opt\_1]

It means that Table top material option price \[opt\_26] is added to price per a square meter \[price] then it is multiplied by the table area \[val\_1]\*\[val\_2] and the Color option price \[opt\_1] is added to the final price.
