> ## Documentation Index
> Fetch the complete documentation index at: https://docs.databar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Excel formulas

> Use familiar spreadsheet formulas directly in your Databar tables.

Databar supports Excel-style formulas natively, so you never need to export your data to a spreadsheet just to run simple calculations or logic. Add a formula column to any table and get instant, row-level results.

<Frame>
  <video muted loop playsInline controls preload="metadata">
    <source src="https://mintcdn.com/databar/QT9PVoe1FFYxOEzf/images/product-guide/excel-formulas.mp4?fit=max&auto=format&n=QT9PVoe1FFYxOEzf&q=85&s=7e572498a7267ae70198351337a760ae" type="video/mp4" data-path="images/product-guide/excel-formulas.mp4" />
  </video>
</Frame>

<Info>
  Formulas are a **transformation**. They are computed locally and do **not** consume any credits.
</Info>

## How it works

Databar formulas use **column references** instead of traditional cell references. Instead of writing `A2` or `B2`, you reference columns by name using curly braces: `{column_name}`.

Each formula runs once per row, with the column references swapped for that row's values. This means every formula is effectively a single-row operation.

For example, if you have columns named `employee_count` and `first_name`, you would write:

```
=IF({employee_count}>100, "High", "Low")
```

## How to use

<Steps>
  <Step title="Open your table">
    Navigate to the table where you want to add formula logic.
  </Step>

  <Step title="Add a formula column">
    Click **Enrich**, then select **Formulas & Tools**. Choose **Excel Formula** from the list.
  </Step>

  <Step title="Write your formula">
    Enter any supported Excel formula, referencing columns by name using `{column_name}` syntax.
  </Step>

  <Step title="View results">
    Results are computed instantly for every row in your table.
  </Step>
</Steps>

## Formula examples

<Tabs>
  <Tab title="Conditional logic">
    Flag companies above a certain employee count:

    ```
    =IF({employee_count}>100, "High", "Low")
    ```
  </Tab>

  <Tab title="Text manipulation">
    Merge first name and last name into a full name:

    ```
    =CONCATENATE({first_name}, " ", {last_name})
    ```
  </Tab>

  <Tab title="Flexible filters">
    Combine multiple conditions for complex filtering:

    ```
    =OR({country}="USA", {headcount}>500)
    ```
  </Tab>

  <Tab title="Calculations">
    Round a value or find the max/min:

    ```
    =ROUND({revenue}, 2)
    =MAX({score_a}, {score_b})
    ```
  </Tab>
</Tabs>

## Available formulas

| Formula       | Description                                                | Example                                        |
| ------------- | ---------------------------------------------------------- | ---------------------------------------------- |
| `IF`          | Returns one value if a condition is true, another if false | `=IF({score}>80, "Pass", "Fail")`              |
| `OR`          | Returns `TRUE` if any argument is true                     | `=OR({country}="USA", {country}="UK")`         |
| `AND`         | Returns `TRUE` if all arguments are true                   | `=AND({age}>18, {status}="active")`            |
| `SUM`         | Adds values together                                       | `=SUM({q1_revenue}, {q2_revenue})`             |
| `CONCATENATE` | Joins text strings into one                                | `=CONCATENATE({first_name}, " ", {last_name})` |
| `RANDBETWEEN` | Returns a random integer between two values                | `=RANDBETWEEN(1, 100)`                         |
| `STDEV`       | Calculates the standard deviation of values                | `=STDEV({score_a}, {score_b}, {score_c})`      |
| `EOMONTH`     | Returns the last day of the month N months from a date     | `=EOMONTH({start_date}, 3)`                    |
| `ROUND`       | Rounds a number to a specified number of digits            | `=ROUND({revenue}, 2)`                         |
| `MAX`         | Returns the largest value from a set of arguments          | `=MAX({bid_a}, {bid_b})`                       |
| `MIN`         | Returns the smallest value from a set of arguments         | `=MIN({price_1}, {price_2})`                   |
| `TODAY`       | Returns today's date                                       | `=TODAY()`                                     |
| `LEN`         | Returns the number of characters in a text string          | `=LEN({description})`                          |
| `TRIM`        | Removes leading and trailing spaces from text              | `=TRIM({raw_name})`                            |
| `LOWER`       | Converts text to lowercase                                 | `=LOWER({email})`                              |
| `UPPER`       | Converts text to uppercase                                 | `=UPPER({ticker})`                             |
| `MID`         | Extracts a substring from the middle of a text string      | `=MID({phone}, 2, 3)`                          |

<Tip>
  Looking for a different transformation? Use [JQ formulas](/product-guide/jq-formulas) to transform JSON data, [Table Lookup](/product-guide/table-lookup) for VLOOKUP-style enrichments across tables, [Split Text](/product-guide/split-text) to break a column into multiple columns, or [Merge Columns](/product-guide/merge-columns) to combine values from several columns into one.
</Tip>

## When to use formulas

* Quick math on numeric columns (revenue, headcount, scores)
* Concatenating text fields without a separate tool
* Building conditional flags or labels for filtering and segmentation
* Rounding, formatting, or normalizing values before export

## Related

<CardGroup cols={2}>
  <Card title="Tables overview" href="/product-guide/tables-overview">
    Learn how tables work in Databar.
  </Card>

  <Card title="JQ formulas" href="/product-guide/jq-formulas">
    For JSON-level querying, use JQ expressions.
  </Card>
</CardGroup>
