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

# Formula FAQ

> When a formula is invalid or can't be computed for the current row, an error code shows in the cell — see the error code list for meanings.

<AccordionGroup>
  <Accordion title="After writing a formula, the cell shows #REF! or similar — what's wrong?">
    When a formula is invalid or can't be computed for the current row, an error code appears in the cell. See [Formula error codes](/aitable/formulas/error-codes) for code meanings.
  </Accordion>

  <Accordion title="Why might the formula be invalid?">
    Check the following:

    **Symbol issues**

    * Operators or brackets in non-English chars (e.g., Chinese quotes "" should be ""\`\`).
    * Mismatched brackets (e.g., `IF(TRUE,0,1))` has an extra closing paren).

    **Data issues**

    * Referenced field is deleted or missing (e.g., `SUM([Field A])` where Field A is gone).

    **Format issues**

    * Percentages should be decimals in computation (10% → 0.1).

    **Syntax issues**

    * Wrong operator usage.

    **Sync issues**

    * Make sure data formats are correct before sync.
  </Accordion>

  <Accordion title={`How do you write "not equal" in an AI Table formula?`}>
    **`!=`** means "not equal" in AI Table formula fields.
  </Accordion>

  <Accordion title="How do you express null in an AI Table formula?">
    Use `= ""` directly, or use `ISBLANK()` to test for empty.
  </Accordion>

  <Accordion title="How do you input emoji or symbols in an AI Table formula?">
    * **Mac**: while editing, right-click the input box, pick "Emoji & Symbols" — pick anything.
    * **Windows**: press **Win + .** to open the emoji keyboard — pick anything.
  </Accordion>

  <Accordion title="Can a formula field be converted to another field type?">
    Yes. Convert to text, number, multi-select, single-select, etc. Only the computed result is preserved — the field loses auto-compute.
  </Accordion>

  <Accordion title="How do I convert a formula field to another type?">
    Right-click the column header → Edit field/column → in the panel, change **Field type** to the desired type.

    Notes:

    * After conversion, auto-compute is lost — only the converted field's behavior remains.
    * Formula return values can be of various types — converted fields may not match. Be careful.
  </Accordion>

  <Accordion title="SUM in a formula field returns empty or errors — what happened?">
    Likely the field type doesn't support sum. Text fields can't sum. Convert to number first.
  </Accordion>

  <Accordion title="How do I adjust the format of a formula field's return value?">
    After computation, right-click the column header → Edit field/column → pick a number format.
  </Accordion>

  <Accordion title="How do I change the display format of a formula field?">
    Double-click the column header to enter edit mode → in the **Number format** dropdown pick the format (integer, decimal, thousands, percent, currency, date, etc.).

    **Supported formats:**

    * Number: integer, decimal, thousands
    * Pro: percent, currency
    * Date: date format
  </Accordion>

  <Accordion title="TEXT() output errors when used in computation — what to do?">
    `TEXT()` returns text. Wrap with `SUM()`, `ABS()`, etc., to convert to a number first.
  </Accordion>

  <Accordion title="SUM result is wrong — why?">
    **Wrong field type**: only number or formula fields support sum. Convert text fields to number.

    **Precision**: too many decimals. Recompute with 4 decimal places.
  </Accordion>

  <Accordion title="What's the data format of date function results?">
    * Storage: timestamp (e.g., 45071 = 2024-01-01).
    * Display: configurable as date in field settings — the underlying data is still a timestamp.
    * Filter: numeric logic (e.g., > 45071 means after 2024-01-01).
  </Accordion>

  <Accordion title="Date shows as a number when concatenated to text — why?">
    Direct concat coerces date to timestamp. Use `TEXT()` to format as text first.

    Example: `[Name] & "'s birthday is " & TEXT([Birthday], "yyyy-mm-dd")`
  </Accordion>

  <Accordion title="Formula result should be a date but shows as a number — why?">
    Double-click the column header, set format to date.
  </Accordion>

  <Accordion title={`How do you express "null" in a formula?`}>
    * Direct check: `[Field] = ""`
    * Function: `ISBLANK([Field])`

      **Example:**

      `IF(ISBLANK([Date]), "Empty", "Not empty")`
  </Accordion>

  <Accordion title="Why does IFS() return `#N/A`?">
    Add a fallback `TRUE`.

    **Example:**

    ```excel formula theme={"theme":{"light":"github-light","dark":"github-dark"}}
    IFS(
     [Score]=100, "Full marks",
     [Score]>=85, "Excellent",
     [Score]>=75, "Good",
     [Score]>=60, "Pass",
     TRUE, "Fail"  // required fallback
    )
    ```
  </Accordion>

  <Accordion title="How do I compute a date N working days later?">
    Use `WORKDAY()` — args: start date, days, optional holidays.

    Syntax: `WORKDAY(start_date, days, [holidays_array])`

    Examples:

    * `WORKDAY("2024/11/01", 10)` → 10 working days later.
    * For custom holidays, create a date array field as the param.
  </Accordion>

  <Accordion title="Max fields a formula can reference?">
    300 fields per formula field.
  </Accordion>

  <Accordion title="How to do basic per-row math?">
    Add a formula field. Reference fields and add operators directly. Example: `[Field 1]+[Field 2]*[Field 3]`
  </Accordion>
</AccordionGroup>

### AI Table 2.0 formula corner

<AccordionGroup>
  <Accordion title="A field looks like a number but I can't do > or < on it — why?">
    **Likely the formula's output type isn't uniform — numbers got coerced to text.**

    Example: **Field 1** formula is `IF([Sales] > 0, [Sales], "No sales")`.

    * **Issue**: returns a **number** when the condition is true, **text** otherwise.
    * **System behavior**: to keep the column type uniform, the system coerces all values to **text** (number 100 becomes text "100").
    * **Consequence**: when **Field 2** does `[Field 1] > 50`, text vs number breaks the comparison — invalid or wrong result.

    **✅ Fix**: keep both IF results the same type.

    * **Bad**: `IF(..., [number], "text")`
    * **Good**: `IF(..., [number], 0)` (use 0 instead of text — keep all numbers)
  </Accordion>
</AccordionGroup>
