function
To replace repetitive formulas

Your first LAMBDA: a reusable ConIVA function

Ask the AI to define a LAMBDA function and use it as =ConIVA(price) from any cell. Replaces copy-pasting the same formula across a thousand rows.

schedule 5 minutes read
  1. Step 1

    What is LAMBDA and why it matters

    A LAMBDA function is a mini-formula you define once and then call like any built-in Excel function. If you have to apply 21% VAT across 50 different columns, instead of writing =A2*1.21 fifty times you define ConIVA once and write =ConIVA(A2). If the rate changes, you change it in a single place.

  2. Step 2

    Ask the AI to define it

    Open the project editor. In the chat type: "Create a ConIVA function that takes a price and adds 21%." The assistant calls the define_function tool and registers =LAMBDA(p, p * 1.21) as a workbook-scoped Named Range.

    💡 Tip: If you want to see the actual formula, expand the tool message in the chat.
  3. Step 3

    Verify with a demo cell

    Ask the AI: "Put =ConIVA(1000) in G1 to check it works." The assistant writes the formula in G1; if your Excel is 365/2021+ you'll see 1210 evaluated. If you see #NAME? it's because your desktop Excel is older or the EJ2 viewer doesn't fully support LAMBDA yet — the downloaded file works fine in Excel 365.

  4. Step 4

    Use it from any cell

    Now you can write =ConIVA(B2) in any sheet of the workbook. The function is workbook-scoped, so it travels with the file: if you export and open elsewhere, it still works.

  5. Step 5

    Functions with multiple parameters

    The same applies to more complex functions. Ask: "Define DescTope that takes a price and a discount, but caps the discount at 30%." The assistant creates =LAMBDA(price, disc, price * (1 - MIN(disc, 0.3))). Call it as =DescTope(A2, B2).

    💡 Tip: Tip: name functions with underscore or CamelCase, and avoid built-in Excel function names (SUM, IF, AVERAGE, etc.) — the system rejects collisions.
  6. Step 6

    Edit and delete from Functions

    Click the Functions button in the editor header. You'll see your LAMBDA listed with a purple badge. Click the pencil icon to edit the expression (e.g. swap 21% for 19% if you move countries), or the red icon to delete it. Each change creates a new version of the file.

  7. Step 7

    When LAMBDA isn't enough

    LAMBDA is great for pure formulas (math, conditionals, lookups). But if you need to iterate over rows, run regex, dedup, or anything with loops or state, LAMBDA can't express it. For those cases the assistant uses compute_with_js — see the next tutorial.

Ready to apply it?

Open ExcelEmpowers and follow these steps on your own Excel.

Create free account ← Browse more tutorials