---
url: /excel-addin/setinstruction.md
description: The SetInstruction formula makes a cell in Excel interactive.
---

# SetInstruction&#x20;

The `SetInstruction` formula makes a cell in Excel interactive. When double clicked, it prompts the user to select an element from a list, based on predefined set instructions. This functionality can be configured through the **Create/Edit Formula Wizard** or directly by typing the formula.

```js
SetInstruction(applicationName, dimension, instructions, selection)
```

#### Parameters

* `applicationName` - The name of the application through which to access the model.
* `dimension` - The dimension for which the set of instructions applies.
* `instructions` -  A list of instructions defining the context and behavior to provide a list of elements.
* `selection` -  The current selected element.

#### Example

```js
SetInstruction("Sales Application", "Product", {"set|All Products", "expand-all", "drill-down"}, "All Products")
```

#### Notes

* You can use Excel cell references within the `instructions` parameter. For example:

  ```js
  SetInstruction("Sales Application", "Product", {"set|Excel(A1)", "expand-all", "drill-down"}, "All Products")
  ```

  In this case, the value of cell `A1` will replace `Excel(A1)` in the instructions.

* Additionally, you can use a range of cells. For example:

  ```js
  SetInstruction("Sales Application", "Product", {"set|Excel(A1:A5)"}, "All Products")
  ```

  Here, all values in the range `A1:A5` will be included as part of the set for the instruction.
