> ## 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.

<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" />
</video>

> [!NOTE]
>
> Formulas are a **transformation**. They are computed locally and do **not** consume any credits.

## 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

**1. Open your table**

Navigate to the table where you want to add formula logic.

**2. Add a formula column**

Click **Enrich**, then select **Formulas & Tools**. Choose **Excel Formula** from the list.

**3. Write your formula**

Enter any supported Excel formula, referencing columns by name using `{column_name}` syntax.

**4. View results**

Results are computed instantly for every row in your table.

## Formula examples

> [tab] Conditional logic
>
> Flag companies above a certain employee count:
>
> ```
> =IF({employee_count}>100, "High", "Low")
> ```

> [tab] Text manipulation
>
> Merge first name and last name into a full name:
>
> ```
> =CONCATENATE({first_name}, " ", {last_name})
> ```

> [tab] Flexible filters
>
> Combine multiple conditions for complex filtering:
>
> ```
> =OR({country}="USA", {headcount}>500)
> ```

> [tab] Calculations
>
> Round a value or find the max/min:
>
> ```
> =ROUND({revenue}, 2)
> =MAX({score_a}, {score_b})
> ```

## 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](https://docs.databar.ai/product-guide/jq-formulas.md) to transform JSON data, [Table Lookup](https://docs.databar.ai/product-guide/table-lookup.md) for VLOOKUP-style enrichments across tables, [Split Text](https://docs.databar.ai/product-guide/split-text.md) to break a column into multiple columns, or [Merge Columns](https://docs.databar.ai/product-guide/merge-columns.md) to combine values from several columns into one.

## 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

> [card] [Tables overview](https://docs.databar.ai/product-guide/tables-overview.md)
>
> Learn how tables work in Databar.

> [card] [JQ formulas](https://docs.databar.ai/product-guide/jq-formulas.md)
>
> For JSON-level querying, use JQ expressions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.