Excel Online — Find cell
Excel Online — Find cell
Section titled “Excel Online — Find cell”Type: excelonline-find-cell · Package: Excel Online v1.0.4 · Output: Dictionary<string,object>
Finds the first cell containing a given value and returns its location. Useful to locate a row or column by its label, or a record by its code, without knowing in advance where it is.
How it works
Section titled “How it works”It works on the session created with Excel Online — Connect. Pass it in the session parameter, or place this activity inside the body of Excel Online — Connect to inherit it automatically.
It reads the sheet’s used range and scans it row by row, left to right; it returns the first match. With match-type you choose whether the value must match exactly, be contained in the cell or be its beginning.
Comparison details:
- It is case-insensitive.
- It compares as text: the value you search for and each cell value are converted to
string. Numbers are compared using their representation in the robot’s regional settings (for example1500or12.5) and dates by their Excel serial number. - It compares the cell value (the result of a formula), not the formatted text shown on screen.
It is read-only: it does not modify the workbook.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
sheet | string | — | Sheet name. |
value | object | — | Value to search for. Compared as text. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanExcelOnlineSession | — | Excel Online — Connect session. Inherited inside Connect’s body. |
match-type | string | "exact" | Match type: exact (the cell equals the value), contains (the cell contains the value) or starts-with (the cell starts with the value). Case-insensitive. |
Output
Section titled “Output”Returns a Dictionary<string,object> with the cell found:
| Key | Type | Content |
|---|---|---|
address | string | A1 address of the cell, without the sheet name (e.g. C5). |
row | int | Row number (1-based). |
column | int | Column number (1-based: A = 1). |
value | object | Cell value, in its original type. |
If nothing is found, it returns null: check it with an If (cell == null) before using the result.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
No Excel Online session available. Provide 'session' from an excelonline-connect activity, or place this activity inside the Connect activity's body so the session is inherited automatically. | The activity is outside Connect’s body and did not receive session. Place it inside the body or pass session = workbook. |
'sheet' is required. / 'value' is required. | The parameter is empty or its expression returned null. |
itemNotFound (Microsoft Graph, 404) | There is no sheet with that name. |
Not finding the value is not an error: the activity returns null.
Example
Section titled “Example”Excel Online — Connect credential = credential("m365-finance") path = "Reports/Invoices.xlsx" └─ body: Excel Online — Find cell sheet = "Invoices" value = invoiceNumber → output: cell If condition = cell != null ├─ then: │ Excel Online — Write cell sheet = "Invoices" cell = "E" + cell["row"] value = "Paid" └─ else: Log level = warning message = "Invoice not found: " + invoiceNumberRelated activities
Section titled “Related activities”- Excel Online — Read cell — read the cell found.
- Excel Online — Write cell — write to the cell found.
- Excel Online — Read range — read around the cell.
- All Excel Online activities