FormulaCraft

How to save a LAMBDA as a named function in Excel and Google Sheets

Topic:LAMBDA (reusable formulas)
Excel & Google Sheets
=TRUNCTEXT(A2, 30)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1In Excel: open Formulas → Name Manager → New. In Google Sheets: open Data → Named Functions → Add new function.
  2. 2Give the function a clear ALL-CAPS name (e.g. TRUNCTEXT). Names follow the same rules as cell names — no spaces, not an existing function name.
  3. 3Define the LAMBDA body. For TRUNCTEXT: LAMBDA(text, n, IF(LEN(text)>n, LEFT(text, n) & "…", text)). In Excel, paste this into the "Refers to" field. In Sheets, enter parameter names separately then the body formula.
  4. 4Add a description and argument hints so colleagues see helpful tooltips when typing the function name.
  5. 5Call the named function from any cell: =TRUNCTEXT(A2, 30) — Excel/Sheets resolves it the same way as any built-in.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Can named LAMBDA functions call other named LAMBDA functions?

Yes, in both Excel and Sheets. You can build a library of composable custom functions where one named function references another.

How do I share named functions between workbooks in Excel?

Named functions are not shared automatically. Copy the formula from Name Manager and recreate it in the destination workbook, or use an Excel add-in template that carries the names.

Are named LAMBDA functions available to VBA or Office Scripts?

No. Named LAMBDA functions are a formula-layer feature only. VBA and Office Scripts cannot call or define them — those require their own function syntax.

More on LAMBDA (reusable formulas)

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: