# Match Function

> `UiPath.Excel.Activities.Business.MatchFunctionX`

`UiPath.Excel.Activities.Business.MatchFunctionX`

Searches for a specified item in a range of cells and returns the relative position of that item in the range. This activity can be used with an Excel file selected for a parent [Use Excel File](https://docs.uipath.com/activities/other/latest/productivity/excel-application-card) activity, an Excel file [connected to the automation](https://docs.uipath.com/studiox/docs/excel-automation#connecting-a-project-to-an-excel-file), or with the Project Notebook.

## Configuring the activity

#### In the body of the activity

* **Value to match** - Select **Plus** on the right side of the field, then, from the menu, select a value using one of the available options:

  + Data from the Project Notebook, a parent Excel file or Outlook account. For example, select a cell in an Excel file, or a field in an Outlook email that contains the value.
  + **Use Saved Value** - Select a variable that you previously saved for later use in the project.
  + **Text** - Enter a value in the Text Builder.
  + **Ask when run** - Prompt for a value when the project is executed.
  + **Number** - Enter a numeric value.
  + **Paste from clipboard** - Paste a value that you previously copied to the clipboard in the project.
  + **Open in Advanced Editor** - Enter a VB expression.
* **In range** - The range to be searched for the value to match. Select **Plus** on the right side of the field and then, from the menu, select a named range or select **Indicate in Excel** to open the file and select a range directly from the file. Alternatively, you can select **Custom Input** to enter the range manually or **Open in Advanced Editor** to enter a VB expression.
* **Match type** - Specify how the value should be matched. Select from the available options:
  + **0** (first value exactly equal to the value to match)
  + **1** (largest value less than or equal to the value to match)
  + **-1** (smallest value greater than or equal to the value to match)
* **Save to** - Save the value returned by the activity (the position of the matched value within the range). If the value to match is not found, `-1` is returned. Select **Plus** on the right side of the field, then, from the menu, select one of the available options to save the resulting value:

  + Data from the Project Notebook, a parent Excel file or Outlook account. For example, select a cell in an Excel file, or a field in an Outlook email where to save the value.
  + **Copy to clipboard** - Save the resulting value to clipboard.
  + **Save for Later Use** - Save the resulting value for later use in your project as input for another activity.
  + **Open in Advanced Editor** - Enter a VB expression.
  :::note
The value returned by the activity is the position of the matched value within the range, not the value itself.
  :::

#### Properties panel

**Common**

* **DisplayName** - The name displayed for the activity in the Designer.

**Input**

* See the options in the body of the activity.

**Misc**

* **Private** - If selected, the values of variables and arguments are no longer logged at Verbose level.

**Output**

* See the options in the body of the activity.
