---
title: "Formula"
description: "A value computed from a mathjs expression on other fields."
canonical_url: "https://docs.vettero.com/data/tables/formula"
---
# Formula

> A value computed from a mathjs expression on other fields.

<field-meta group="Computed" icon="i-lucide-square-function" type="formula" unique="No" value="Computed">



</field-meta>

**Formula** is computed from a [mathjs](https://mathjs.org/docs/expressions/syntax.html) expression. You do not type a cell value. Changing Config does not rewrite existing cells until you **Recalculate values**.

Name, key, hidden, and permissions are the same for every column — see [Tables](https://docs.vettero.com/data/tables).

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Expression
      </strong>
    </td>
    
    <td>
      <a href="https://mathjs.org/docs/expressions/syntax.html" rel="nofollow">
        mathjs
      </a>
      
       formula. Use other columns on the row by their <strong>
        key
      </strong>
      
       (for example <code>
        price * quantity
      </code>
      
      ). Operators include <code>
        +
      </code>
      
      , <code>
        -
      </code>
      
      , <code>
        *
      </code>
      
      , <code>
        /
      </code>
      
      , and <code>
        ^
      </code>
      
      . Functions such as <code>
        sqrt(x)
      </code>
      
      , <code>
        round(x)
      </code>
      
      , and <code>
        abs(x)
      </code>
      
       are available — see the <a href="https://mathjs.org/docs/reference/functions.html" rel="nofollow">
        mathjs function list
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Return type
      </strong>
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Text
      </strong>
      
      , or <strong>
        Boolean
      </strong>
    </td>
  </tr>
</tbody>
</table>

## Use case

- Line totals (`price * quantity`), tax, discounts, or pass/fail (`score >= 70`) without typing the result.
- Return **Number**, **Text**, or **Boolean** depending on whether you need an amount, a label, or a flag.
- Feed a number result into [Progress](https://docs.vettero.com/data/tables/progress) as min, max, or current value.

<field-page-nav>



</field-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
