# Generate Formulas Using AI

> Part of the NocoDB documentation (Product docs > NocoAI). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/product/noco-ai/create-formula
Last updated: 2026-10-03

Generate NocoDB formulas from plain-language prompts with NocoAI.

## Overview

Formulas can be complex and slow to write. With **NocoAI**, you describe the logic that you need in plain English. NocoAI then generates the formula for you.

Use it if you are a non-technical user, or a power user who wants to write formulas faster. It also helps you prevent syntax errors.

## Steps to Generate Formulas Using AI

1. In your table, add a field and select **Formula** as the type.

2. In the formula editor, click **✨ Formula Helper**. The prompt-based generation interface opens.

3. Write a short prompt that tells what the formula must do.

   *Example*:

   > Show "✅ Done" if Status is "Completed", else show "⏳ In Progress".

4. Click **Generate**. NocoAI generates the formula from your prompt in the formula editor.

5. Review the formula, and change it if necessary.

6. When the result is correct, click **Save**. NocoAI saves the field.

<div style={{ display: "flex", gap: "1rem" }}>
  <img src="/img/v2/noco-ai/create-formula-1.png" alt="Formula field using AI - Step 1" style={{ width: "50%", borderRadius: "8px", boxShadow: "0 0 8px rgba(0,0,0,0.05)" }} />

  <img src="/img/v2/noco-ai/create-formula-2.png" alt="Formula field using AI - Step 2" style={{ width: "50%", borderRadius: "8px", boxShadow: "0 0 8px rgba(0,0,0,0.05)" }} />
</div>

## Tips for Better Formula Suggestions

* **Be precise in your prompt**

  Use the exact field names and values when possible.
  *Example*:

  > Calculate number of days between Start Date and End Date.

* **Use conditional phrases**

  These help the AI understand your intent.
  *Example*:

  > If Priority is "High" and Status is not "Completed", show "⚠️ Urgent".

* **Refer to data types clearly**

  Say if you work with dates, numbers, checkboxes, or text.
  *Example*:

  > Add 7 days to the Created Date.

## Example Prompts and Outcomes

| Prompt                                             | Resulting Formula (Example)                       |
| -------------------------------------------------- | ------------------------------------------------- |
| If Status is "Done", show "✅", else show "⏳"       | `IF({Status} = "Done", "✅", "⏳")`                 |
| Show the number of days between Start and End Date | `DATETIME_DIFF({End Date}, {Start Date}, "days")` |
| If Due Date is past today, mark as "Overdue"       | `IF({Due Date} < TODAY(), "Overdue", "")`         |
| Combine First Name and Last Name into one field    | `CONCAT({First Name}, " ", {Last Name})`          |

## What’s Next

After your formula field is ready, you can:

* Use **[NocoAI View Suggestions](/docs/product/noco-ai/create-view)** to show data based on these formulas
* Create **[Fields using AI](/docs/product/noco-ai/create-field)** to automatically generate relevant fields for your table

NocoAI makes complex logic simple, so you can focus on your workflows.

## Availability

* AI formula generation is available on **NocoDB Cloud** (Plus plan and above). On Cloud, it uses [credits](/docs/product/workspaces/credits).
* On self-hosted deployments (Business plan and above), you must configure your own AI integration.

---

## Related pages

- [What NocoAI can do](https://nocodb.com/docs/product/noco-ai/capabilities.md): The full list of actions that the NocoAI assistant can do in NocoDB, the role each action needs, and what NocoAI cannot do yet.
- [Create Base Using AI](https://nocodb.com/docs/product/noco-ai/create-base.md): Generate a complete NocoDB base with tables, views, fields and relationships from a plain-language prompt with NocoAI.
- [Create Tables Using AI](https://nocodb.com/docs/product/noco-ai/create-table.md): Generate NocoDB tables and their relationships from plain-language prompts with NocoAI.
- [Create Views Using AI](https://nocodb.com/docs/product/noco-ai/create-view.md): Generate useful views for a NocoDB table with NocoAI.
- [Filter Records Using AI](https://nocodb.com/docs/product/noco-ai/create-filter.md): Filter NocoDB table records with a plain-language description through NocoAI.
- [Create Fields Using AI](https://nocodb.com/docs/product/noco-ai/create-field.md): Generate relevant fields for a NocoDB table from a description with NocoAI.
- [Create Options Using AI](https://nocodb.com/docs/product/noco-ai/create-options.md): Generate options for NocoDB Single Select and Multi Select fields with NocoAI.
