# Lookup Workbook (preview)

> Lookup Workbook activity that finds a value in a range using the Excel LOOKUP function and returns the corresponding value from a result range.

`UiPath.Excel.Activities.Lookup`

## Description

Looks up a value in a single row or column of cells and returns the corresponding value from a result range, using the Excel `LOOKUP` function. This is the cross-platform equivalent of the [Lookup](https://docs.uipath.com/activities/other/latest/productivity/lookup-x) Windows activity.

:::note
This activity does not support `.xls` files.
:::

## Project compatibility

Windows | Cross-platform

## Properties

### Common

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

### Input

* **File** - The full path of the resource workbook. To switch to a local path, select the plus icon, and then **Use Local File**. The current field changes to **File (local path)**, where you can provide the full path of the workbook.
* **SheetName** - The name of the sheet from the workbook.
* **Lookup Range** - The range to search in. It must be a single row or a single column. If you don't set **Result Range**, the value is also returned from this range. This field is required.
* **Lookup Value** - The value to search for. This field is required.

### Options

* **Result Range** - The range to return a value from. It must be a single row or a single column, with the same number of cells as **Lookup Range**. If you don't set this field, the activity returns the value from **Lookup Range**.
* **Password** - The password of the workbook, if necessary.

### Output

* **Result** - The value that the activity found, or `null` if the lookup value is not found. You can store the value in a variable of any type. The value is converted if the type is different.

### Use Workbook

* **Workbook** - The existing workbook to use instead of a file path.

## Notes

* The activity performs an approximate match. It returns the value that corresponds to the largest entry in **Lookup Range** that is less than or equal to **Lookup Value**. **Lookup Range** must be sorted in ascending order to get correct results, as in the Excel `LOOKUP` function.
* If **Lookup Value** is smaller than every entry in **Lookup Range**, or its type is not compatible with the range, such as a number against a range of text, the activity doesn't find a match and **Result** is `null`. A number and a date are compatible, because Excel stores dates as numbers. A number can match a date cell, and the other way around.
* For an exact match, use [VLookup Workbook](https://docs.uipath.com/activities/other/latest/productivity/v-lookup-workbook) with **Exact Match** selected.
* **Lookup Range** and **Result Range** must refer to the sheet in **SheetName**. A range that includes a sheet name, such as `Sheet2!A1:A10`, is not supported and causes an error.
* A whole-column or whole-row range, such as `A:A`, is limited to the used range of the sheet.
* The activity fails with an error if **Lookup Range** is empty, if **Lookup Range** or **Result Range** is not a single row or column, if the two ranges have a different number of cells, or if **Lookup Value** is `null`.
