Google Sheets named functions let you save a long formula under a short name, such as =CLEAN_EMAIL(A2), and reuse it anywhere in the file without Apps Script. This guide shows how to create one step by step, gives 10 copy-paste examples with sample results, and explains how to import them into other files and fix the errors you may hit.
Quick answer: Click Data > Named functions, add a new function, give it a name and argument placeholders, paste a formula that uses those placeholders, and create it. Then call it like any built-in function.
- Open Data > Named functions and add a new function.
- Enter a Function name such as CLEAN_EMAIL and a short description.
- Add an argument placeholder, for example addr.
- In Formula definition, enter a formula that uses addr instead of a cell reference.
- Finish the wizard, then type =CLEAN_EMAIL(A2) in a cell to test it.
In this guide
- What are Google Sheets Named Functions (and why they matter)
- When to use named functions vs alternatives
- Step‑by‑step: create your first named function (CLEAN_EMAIL)
- 10 copy‑paste named functions you’ll actually use
- Design rules for reliable named functions
- Performance tips
- Named functions vs Excel’s LAMBDA vs Apps Script
- Team rollout and governance
- Practical applications (copy these setups)
- Next steps
- Trusted sources and official docs
- Common named function errors and fixes
- Frequently Asked Questions
What are Google Sheets Named Functions (and why they matter)
Named functions are custom formulas you create from existing Sheets functions (like FILTER, TEXT, REGEXREPLACE, XLOOKUP). You define inputs once, add documentation, and reuse the logic anywhere in the file (or import it into other files). They're like macros for formulas—ideal for data cleaning, reporting templates, and onboarding new teammates.
- Readable: Replace long formulas with clear names (e.g., =CLEAN_EMAIL(A2)).
- Reusable: Use the same logic across tabs and files.
- Maintainable: Update in one place instead of fixing dozens of cells.
- Governed: Add descriptions and argument hints your team sees on hover.
When to use named functions vs alternatives
- Use Named Functions when your logic is expressible with built‑in functions and needs no external API calls or loops.
- Use Apps Script custom functions when you need HTTP requests, advanced logic, or cross‑file automation.
- Use Named Ranges if you only need readable references, not reusable logic.
Step‑by‑step: create your first named function (CLEAN_EMAIL)
- Select Data → Named functions.
- Click Add new function. Name it CLEAN_EMAIL. Add a description: “Lowercase email and remove stray spaces/illegal characters.”
- Add an argument placeholder: addr.
- In the formula box, paste:
Keep the hyphen at the end of the character class; in the middle (
=REGEXREPLACE(LOWER(TRIM(addr)), "[^a-z0-9._%+@-]", "")+-@) it would be read as a range and let characters such as<,;and=through. - Click Next → Create. Use it like:
=CLEAN_EMAIL(A2)
If A2 holds Jane.Doe@Example.COM; , the cell should now show jane.doe@example.com: the spaces are trimmed, the text is lowercased and the semicolon is removed. You can also start from a cell that already has a formula: right-click it, choose View more cell actions > Define named function.
Names follow a few rules from Google’s help page: a function name cannot match a built-in function such as SUM, cannot look like a cell reference such as A1, cannot start with a number, and may only use letters, numbers and underscores. Placeholder names follow the same reference and character rules.
10 copy‑paste named functions you’ll actually use
For each one, create a named function with the name and placeholders shown in the heading, and paste the formula into Formula definition. This is what five of them return on sample inputs:
| Call | Input | Result |
|---|---|---|
=SLUGIFY(A2) | Hello, World! 2026 Guide | hello-world-2026-guide |
=SLUGIFY(A3) | Café au lait | caf-au-lait (accented letters are dropped) |
=PHONE_NORMALIZE(A4) | (415) 555-0132 | 4155550132 |
=DOMAIN_FROM_EMAIL(A5) | Jane.Doe@Example.COM | example.com |
=ISO_WEEK_START(A6) | 2026-11-26 (a Thursday) | 2026-11-23 (the Monday); format the cell as a date if you see a number |
1) SLUGIFY(text)
Make URL‑friendly slugs.=LOWER(REGEXREPLACE(REGEXREPLACE(TRIM(text), "[^a-zA-Z0-9]+", "-"), "^-+|-+$", ""))2) UNIQUE_NONBLANKS(range)
Unique values, ignore blanks.=SORT(UNIQUE(FILTER(range, LEN(range))))3) SAFE_XLOOKUP(key, lookup_col, return_col, not_found)
Exact match with friendly fallback.=XLOOKUP(key, lookup_col, return_col, not_found)4) DEPENDENT_LIST(parent, keyCol, valCol)
Child list for dependent dropdowns (spill‑safe). The dependent dropdowns guide shows where this list plugs in.
=IFERROR(SORT(UNIQUE(FILTER(valCol, keyCol = parent))), "")5) TEXTJOIN_CSV(range)
Join cleaned list as comma‑separated values.
=TEXTJOIN(", ", TRUE, FILTER(range, LEN(range)))6) PHONE_NORMALIZE(text)
Digits‑only phone standardization.=REGEXREPLACE(TO_TEXT(text), "[^0-9]", "")7) DOMAIN_FROM_EMAIL(addr)
Extract domain from email.=IFERROR(INDEX(SPLIT(LOWER(TRIM(addr)), "@"), 1, 2), "")8) DEDUPE_TABLE(rows, dedupe_col)
Return first occurrence rows based on a key column.
=FILTER(rows, IFERROR(MATCH(dedupe_col, dedupe_col, 0), 0) = ROW(dedupe_col) - ROW(INDEX(dedupe_col, 1, 1)) + 1)9) LAST_NONBLANK(range)
Last populated cell in a column.=INDEX(FILTER(range, LEN(range)), COUNTA(FILTER(range, LEN(range))))10) ISO_WEEK_START(date)
Get the Monday of the ISO week for a date.
=date - MOD(WEEKDAY(date, 2) - 1, 7)Design rules for reliable named functions
- Always TRIM and normalize text case (LOWER/UPPER).
- Wrap lookups with clear if_not_found messages.
- Add IFERROR for spill‑safe lists and user‑blank inputs.
- Prefer FILTER + UNIQUE + SORT for dynamic ranges.
- Document arguments; include examples in the description field.
Performance tips
- Scope ranges (A2:A5000) instead of entire columns where possible.
- Centralize heavy calculations with named functions; reuse results instead of duplicating formulas.
- Minimize volatile constructs or repeated regex work inside massive arrays.
- Test with sample data, then scale—measure recalc time when you paste thousands of rows.
Named functions vs Excel’s LAMBDA vs Apps Script
- Named Functions: fastest no‑code reuse for Sheets logic; shareable by importing them into other files.
- Excel LAMBDA: similar concept in Excel; migrating logic is usually straightforward with minor syntax tweaks.
- Apps Script: use for APIs, file automation, custom menus/triggers.
Team rollout and governance
- Create a Library sheet tab documenting each named function (name, purpose, arguments, example).
- Prefix conventions: TXT_ for text, LIST_ for lists, SAFE_ for guarded lookups.
- Review changes in a copy, then import the function set to production files.
- Protect the Library tab; grant edit to owners only.
Practical applications (copy these setups)
Data cleaning pipeline
=CLEAN_EMAIL(A2),=PHONE_NORMALIZE(B2),=SLUGIFY(C2)- Join results with
=TEXTJOIN_CSV(D2:D)for exports.
Ops dashboards
=SAFE_XLOOKUP(E2, SKUs!A:A, SKUs!D:D, "No SKU")- Dependent filters via
=DEPENDENT_LIST(B2, Catalog!A:A, Catalog!C:C)
Project templates
- De‑duplicate owners:
=UNIQUE_NONBLANKS(Projects!B:B) - Week anchors:
=ISO_WEEK_START(TODAY())
Next steps
Pick the formula your team copies most often, turn it into your first named function and test it on the sample inputs above. Good candidates are lookups such as SAFE_XLOOKUP (see XLOOKUP vs VLOOKUP) and text cleaners built from the patterns in the REGEXEXTRACT data cleaning guide.
Trusted sources and official docs
- Google Workspace Updates: Named functions for Sheets: workspaceupdates.googleblog.com
- Google Sheets Help: Data validation (for dependent lists): support.google.com/docs/answer/186103
- Google Sheets Function list: support.google.com/docs/table/25273
- FILTER function: support.google.com/docs/answer/3093197
- UNIQUE function: support.google.com/docs/answer/10522653
- REGEXREPLACE function: support.google.com/docs/answer/3098245
- TEXTJOIN function: support.google.com/docs/answer/7013992
- XLOOKUP function: support.google.com/docs/answer/12405947
Common named function errors and fixes
- #NAME? “Unknown function”: the function exists in another file, not this one. Import it with Data → Named functions → Import function, or check the spelling.
- Sheets will not save the name: the name clashes with a built-in function, looks like a cell reference (for example
TAX_RATEis fine, butAB12orTAX2026is not, because both look like cell references), starts with a number or contains a space. Use letters, numbers and underscores. - Wrong number of arguments: every call must pass one value per placeholder, in order. Check the argument list shown when you type the function name.
- #REF! “Array result was not expanded because it would overwrite data”: functions that return lists, such as UNIQUE_NONBLANKS or DEPENDENT_LIST, need empty cells below or to the right.
- “Calculation limit was reached”: a recursive named function ran too long or used too much memory. Simplify it or avoid recursion on large ranges.
- The function returns the wrong range: ranges typed inside the formula definition are absolute. Pass ranges in as arguments instead, so each call uses its own cells.
Frequently Asked Questions
Do named functions work across files?
Not automatically. A named function belongs to the file it was created in. To reuse it, open the other file and go to Data → Named functions → Import function, then choose the source spreadsheet and the functions you want. An imported function replaces one with the same name.
Can I edit a named function later?
Yes. Open Data → Named functions, edit the definition once, and every cell in that file that calls it updates automatically. Copies imported into other files do not change; import the function again there to pick up the new version.
What’s the difference between named functions and Apps Script custom functions?
Named functions are built only from native Sheets formulas, need no code and no authorization. Apps Script custom functions are JavaScript, so they can call APIs and run loops, but they are slower and limited to 30 seconds per call. A named function cannot share a name with a custom function in the same file.
Can one named function call another, or itself?
Yes to both. A named function can use another named function in its definition, and Google’s help page shows a recursive example. Keep chains short, document them on your Library tab, and import dependent functions together, because Sheets warns you when a dependency is missing.
Can I use LAMBDA, MAP or BYROW inside a named function?
Yes. Google Sheets has LAMBDA and helper functions such as MAP, BYROW and REDUCE, and you can use them in a formula definition like any other function. That is the usual way to make a named function apply per-row logic to a whole range.

