Skip to content

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.

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 example 1500 or 12.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.

ParameterTypeDefaultDescription
sheetstring—Sheet name.
valueobject—Value to search for. Compared as text.
ParameterTypeDefaultDescription
sessionZoanExcelOnlineSession—Excel Online — Connect session. Inherited inside Connect’s body.
match-typestring"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.

Returns a Dictionary<string,object> with the cell found:

KeyTypeContent
addressstringA1 address of the cell, without the sheet name (e.g. C5).
rowintRow number (1-based).
columnintColumn number (1-based: A = 1).
valueobjectCell value, in its original type.

If nothing is found, it returns null: check it with an If (cell == null) before using the result.

MessageCause 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.

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: " + invoiceNumber