Skip to content
Open
41 changes: 38 additions & 3 deletions docs/excel/custom-functions-json.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Manually create JSON metadata for custom functions in Excel
description: Define JSON metadata for custom functions in Excel and associate your function ID and name properties.
ms.date: 01/05/2026
ms.date: 04/20/2026
ms.localizationpriority: medium
---

Expand All @@ -22,13 +22,46 @@ The following image explains the differences between using `yo office` scaffold
:::image type="content" source="../images/custom-functions-json.png" alt-text="Image of differences between using the Yeoman generator for Office Add-ins and writing your own JSON.":::

> [!NOTE]
> Remember to connect your manifest to the JSON file you create, through the `<Resources>` section in your add-in only manifest file if you do not use the [Yeoman generator for Office Add-ins](../develop/yeoman-generator-overview.md).
> Remember to connect your manifest to the JSON file you create. In the unified manifest, use the `customFunctions.metadataUrl` property. In the add-in only manifest, use the `<Resources>` section. If you use the [Yeoman generator for Office Add-ins](../develop/yeoman-generator-overview.md), this connection is configured automatically.

## Authoring metadata and connecting to the manifest

Create a JSON file in your project and provide all the details about your functions in it, such as the function's parameters. See the [following metadata example](#json-metadata-example) and [the metadata reference](#metadata-reference) for a complete list of function properties.

Ensure your add-in only manifest file references your JSON file in the `<Resources>` section, similar to the following example.
The way you connect your manifest file to your JSON metadata file depends on which manifest type you're using.

# [Unified manifest for Microsoft 365](#tab/jsonmanifest)

In the unified manifest, reference your JSON metadata file using the `customFunctions.metadataUrl` property within the `extensions` array:

```json
{
"extensions": [
{
"requirements": {
"scopes": ["workbook"],
"capabilities": [
{
"name": "CustomFunctionsRuntime",
"minVersion": "1.1"
}
]
},
"customFunctions": {
"namespace": {
"id": "CONTOSO",
"name": "CONTOSO"
},
"metadataUrl": "https://subdomain.contoso.com/config/customfunctions.json"
}
}
]
}
```

# [Add-in only manifest](#tab/xmlmanifest)

Ensure that your add-in only manifest file references your JSON file in the `<Resources>` section, similar to the following example.

```json
Comment thread
alison-mk marked this conversation as resolved.
Outdated
<Resources>
Expand All @@ -43,6 +76,8 @@ Ensure your add-in only manifest file references your JSON file in the `<Resourc
</Resources>
```

---

## JSON metadata example

The following example shows the contents of a JSON metadata file for an add-in that defines custom functions. The sections that follow this example provide detailed information about the individual properties within this JSON example.
Expand Down
27 changes: 26 additions & 1 deletion docs/excel/custom-functions-naming.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Naming and localization for custom functions in Excel
description: Learn requirements for names of Excel custom functions and how to localize custom functions.
ms.date: 10/22/2025
ms.date: 04/20/2026
ms.localizationpriority: medium
---

Expand Down Expand Up @@ -46,6 +46,31 @@ Fix conflicts by renaming your function or uninstalling the other add-in. For te
- For streaming functions, add `STREAM` to the name or include a note in the description.
- Use a short vendor prefix in your function names to avoid conflicts with other add-ins. For example, use `CONTOSO_GETPRICE` or `CONTOSO_TAX_CALC`.

## Namespace configuration

The namespace for your custom functions is configured in the manifest file. The configuration approach depends on which manifest type you're using.

# [Unified manifest for Microsoft 365](#tab/jsonmanifest)

In the unified manifest, configure the namespace in the `customFunctions.namespace` object:

```json
"customFunctions": {
"namespace": {
"id": "CONTOSO",
"name": "CONTOSO"
}
}
```

The `id` property is used internally and must remain stable, while the `name` property is the display name that users see in Excel and can be localized.

# [Add-in only manifest](#tab/xmlmanifest)

In the add-in only manifest, specify the namespace using the `<Namespace>` element in the `<ExtensionPoint>` section. The namespace value should follow the naming guidelines described in this article.

---

[!include[manifest guidance](../includes/manifest-guidance.md)]

## Naming constraints quick reference
Expand Down
24 changes: 19 additions & 5 deletions docs/excel/custom-functions-overview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Create an Excel custom function for your Office Add-in.
title: Create custom functions in Excel
ms.date: 01/22/2026
ms.date: 04/20/2026
ms.topic: overview
ms.custom: scenarios:getting-started
ms.localizationpriority: high
Expand Down Expand Up @@ -69,13 +69,29 @@ function add(first, second){

### Manifest file

The manifest file for an add-in that defines custom functions configures the namespace, specifies file locations, and defines the runtime. Select the tab for the manifest type you're using.

# [Add-in only manifest](#tab/xmlmanifest)

The add-in only manifest file for an add-in that defines custom functions (**./manifest.xml** in the project that the [Yeoman generator for Office Add-ins](../develop/yeoman-generator-overview.md) creates) does several things.

- Defines the namespace for your custom functions. A namespace prepends itself to your custom functions to help customers identify your functions as part of your add-in.
- Uses `<ExtensionPoint>` and `<Resources>` elements that are unique to a custom functions manifest. These elements contain the information about the locations of the JavaScript, JSON, and HTML files.
- Specifies which runtime to use for your custom function. We recommend always using a shared runtime unless you have a specific need for another runtime, because a shared runtime allows for the sharing of data between functions and the task pane.
- Specifies the runtime to use for your custom function. We recommend that you always use a shared runtime unless you have a specific need for another runtime, because a shared runtime allows for the sharing of data between functions and the task pane.

To see a full working manifest from a sample add-in, see the manifest in [one of our Office Add-in samples GitHub repositories](https://github.com/OfficeDev/Office-Add-in-samples/blob/main/Samples/excel-shared-runtime-global-state/manifest.xml).

---

Comment thread
alison-mk marked this conversation as resolved.
Outdated
To see a full working manifest from a sample add-in, see the manifest in the [one of our Office Add-in samples Github repositories](https://github.com/OfficeDev/Office-Add-in-samples/blob/main/Samples/excel-shared-runtime-global-state/manifest.xml).
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)

The unified manifest for an add-in that defines custom functions (**./manifest.json** in the project) does several things.

- Defines the namespace for your custom functions using the `customFunctions.namespace` object. A namespace prepends itself to your custom functions to help customers identify your functions as part of your add-in.
- Uses the `customFunctions` extension to specify metadata about custom functions, including the JSON metadata file location via the `metadataUrl` property.
- Configures the runtime for custom functions using the `runtimes` array with an `actions.type` property set to `"executeFunction"`.

To see a full working manifest from a sample add-in, see the manifest in [one of our Office Add-in samples GitHub repositories](https://github.com/OfficeDev/Office-Add-in-samples/blob/main/Samples/excel-shared-runtime-scenario/manifest.json).
Comment thread
alison-mk marked this conversation as resolved.

[!include[manifest guidance](../includes/manifest-guidance.md)]
Comment thread
alison-mk marked this conversation as resolved.

Expand All @@ -89,8 +105,6 @@ For more information on coauthoring, see [About coauthoring in Excel](/office/vb

Excel custom functions are supported by most Office client applications. Excel custom functions aren't currently supported in **Office on iPad** or **volume-licensed perpetual versions of Office 2021 or earlier on Windows**. For more information, see [Custom functions requirement sets](/javascript/api/requirement-sets/excel/custom-functions-requirement-sets).

[!include[Excel custom functions note](../includes/excel-custom-functions-note.md)]

## Next steps

Want to try out custom functions? Check out the simple [custom functions quick start](../quickstarts/excel-custom-functions-quickstart.md) or the more in-depth [custom functions tutorial](../tutorials/excel-tutorial-create-custom-functions.md) if you haven't already.
Expand Down
8 changes: 3 additions & 5 deletions docs/excel/custom-functions-troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 08/26/2025
ms.date: 04/20/2026
description: Troubleshoot common problems with Excel custom functions.
title: Troubleshoot custom functions
ms.topic: troubleshooting
Expand All @@ -10,9 +10,7 @@ ms.localizationpriority: medium

When developing custom functions, you may encounter errors in the product while creating and testing your functions.

[!include[Excel custom functions note](../includes/excel-custom-functions-note.md)]

To resolve issues, you can [enable runtime logging to capture errors](#enable-runtime-logging) and refer to [Excel's native error messages](#check-for-excel-error-messages). Also, check for common mistakes such as [leaving promises unresolved](#ensure-promises-return).
To resolve issues, [enable runtime logging to capture errors](#enable-runtime-logging) and refer to [Excel error messages](#check-for-excel-error-messages). Also, check for common mistakes such as [leaving promises unresolved](#ensure-promises-return).

## Debugging custom functions

Expand All @@ -28,7 +26,7 @@ If you're testing your add-in in Office on Windows, you should [enable runtime l

Excel has a number of built-in error messages which are returned to a cell if there is calculation error. Custom functions only use the following error messages: `#NULL!`, `#DIV/0!`, `#VALUE!`, `#REF!`, `#NAME?`, `#NUM!`, `#N/A`, and `#BUSY!`.

Generally, these errors correspond to the errors you might already be familiar with in Excel. The are only a few exceptions specific to custom functions, listed here:
Generally, these errors correspond to the errors you might already be familiar with in Excel. There are only a few exceptions specific to custom functions, listed here:

- A `#NAME?` error generally means there has been an issue registering your functions. For additional information, see [Custom functions showing #NAME? error](#custom-functions-showing-name-error).
- A `#N/A` error is also maybe a sign that that function while registered could not be run. This is typically due to a missing `CustomFunctions.associate` command.
Expand Down
2 changes: 0 additions & 2 deletions docs/includes/excel-custom-functions-note.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/quickstarts/excel-custom-functions-quickstart.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Custom functions quick start
description: Developing custom functions in Excel quick start guide.
ms.date: 08/22/2024
ms.date: 04/20/2026
ms.service: excel
ms.localizationpriority: high
---
Expand All @@ -28,7 +28,7 @@ To start, you'll use the Yeoman generator to create the custom functions project

The Yeoman generator will create the project files and install supporting Node components.

1. The Yeoman generator will give you some instructions in your command line about what to do with the project, but ignore them and continue to follow our instructions. Navigate to the root folder of the project.
1. The Yeoman generator gives you instructions in your command line about the project, but you should continue to follow the instructions in this article. Navigate to the root folder of the project.

```command&nbsp;line
cd "My custom functions add-in"
Expand Down