# Create Custom Names

## Content

Custom user-defined names are identifiers that represent information in the sheet. A custom name can refer to a range of cells or a formula.
You can define a custom name and then use the name in formulas. When the formula is evaluated, the custom name's value is referenced and evaluated. Use the [addCustomName](/spreadjs/api/v16/classes/GC.Spread.Sheets.Worksheet#addCustomName) method to create a custom name.
The following code sample creates a custom name.

```javascript
activeSheet.setValue(0, 0, 1);
activeSheet.setValue(0, 1, 2);
activeSheet.setValue(0, 2, 3);

// Add custom name by setting the isReadOnly parameter to true
activeSheet.addCustomName("customName1","=12", 0, 0, 'readonly', true);

activeSheet.addCustomName("customName2","Average(20,45)", 0, 0);
activeSheet.addCustomName("customName3", "=$B$1:$C$1", 0, 0);

activeSheet.setFormula(1, 0, "customName1");
activeSheet.setFormula(1, 1, "customName2");
activeSheet.setFormula(1, 2, "sum(customName3)");
```

SpreadJS does not allow you to change or remove read-only custom names from the [Name Manager Dialog](/spreadjs/docs/v16/spdesigner/spdesignerwork/name-box#using-name-manager-dialog) in SpreadJS Designer. If you select a read-only custom name, the **Edit** and **Delete** buttons are disabled, and double-clicking on the read-only custom name will be unresponsive. The read-only status of a custom name can only be set or changed using the API.

![NameManagerDialog_readOnlyName](https://gcdocumentsitekrblob.blob.core.windows.net/document-site-files/images/df1fe1ee-eb3c-4da7-8c20-a0d8d2b7e734/NameManagerDialog_readOnlyName.057d7a.png?width=531)