-
Notifications
You must be signed in to change notification settings - Fork 542
command query excel
zmworm edited this page Mar 19, 2026
·
54 revisions
Query selectors for Excel documents.
| Selector | Description |
|---|---|
cell |
Cells |
row |
Rows |
sheet |
Sheets |
validation |
Data validations |
comment / note
|
Comments |
table / listobject
|
Tables |
chart |
Charts |
pivottable / pivot
|
Pivot tables |
Column letters (A, B, AB) |
Cells in specific column |
| Attribute | Description |
|---|---|
value |
Exact value match |
type |
String, Number, Boolean
|
formula |
true / false
|
empty |
true / false
|
| Selector | Description |
|---|---|
:contains("text") |
Cell contains text |
:empty |
Cell is empty |
:has(formula) |
Cell has a formula |
Shorthand: :text is equivalent to :contains("text") -- e.g., pivot:Sales matches pivot tables whose name contains "Sales".
Filter by sheet: Sheet1!cell[value="100"]
# Cells with formulas
officecli query data.xlsx "cell:has(formula)"
# Cells containing text
officecli query data.xlsx 'cell:contains("Revenue")'
# Empty cells
officecli query data.xlsx "cell:empty"
# Column B non-zero values
officecli query data.xlsx "B[value!=0]"
# String-type cells
officecli query data.xlsx "cell[type=String]"
# Formulas in specific sheet
officecli query data.xlsx "Sheet2!cell[formula=true]"
# All comments
officecli query data.xlsx "comment"
# All tables
officecli query data.xlsx "table"
# All pivot tables
officecli query data.xlsx "pivottable"
# Pivot tables containing "Sales" in name
officecli query data.xlsx 'pivot:contains("Sales")'
# Shorthand form
officecli query data.xlsx "pivot:Sales"- query - Command syntax
- Excel Reference - All Excel elements
Based on OfficeCli v1.0.7