Skip to main content

Excel Formula: HEALTHROTA.QUERY

Returns HealthRota reporting data, with the filters and columns taken from cells.

Returns HealthRota reporting data into the sheet, with the filters and columns taken from cells. Change a filter cell and the data updates.

The task pane's Insert live query button writes this formula for you, with the filter cells already laid out.

Syntax

=HEALTHROTA.QUERY(type, filterRange, [columnRange])

Argument

Required

Description

type

Yes

The data type. Use the resource name, such as "work_items", or the name shown in the task pane's Data type list, such as "WorkItems".

filterRange

Yes

A range three columns wide. Each row is one filter: field, operator, value. Blank rows are skipped, so a range with no filters filled in returns every row you have access to.

columnRange

No

Cells holding the column names to return, one per cell, or comma-separated in one cell. Leave it out to return every column.

The result always has a header row. It spills down and across from the formula cell. Keep those cells empty, or Excel shows #SPILL!.

Example

      A          B          C
1 Field Operator Value
2 rota_id in 1,2,3
3 date gte 2026-01-01
4 Columns id date user_id

6 =HEALTHROTA.QUERY("work_items", A2:C3, B4:D4)

This returns the id, date and user_id of every work item on rotas 1, 2 and 3 from 1 January 2026. Change C3 to 2026-02-01 and the result updates.

Filter cells

  • Operators: eq, neq, lt, lte, gt, gte, in, range, contains, starts_with, ends_with.

  • For in, put the values comma-separated in the one Value cell: 1,2,3.

  • For range, put the two values comma-separated in the one Value cell, lowest first: 2026-01-01,2026-03-31. Both ends are included.

  • A date-formatted cell works as the value for eq, gte, lte and the other single-value operators. For a date range, type both dates as text in one cell.

  • Do not put quotes around text values.

  • All filters must match for a row to be returned.

See Filtering reporting data for every operator, how dates are read, and which fields each data type accepts.

Errors

Hover over the error cell to read the message.

Cell shows

Message

What to do

#N/A

Sign in via the HealthRota task pane first

Open HealthRota > Reporting on the Home tab and sign in.

#N/A

Session could not be renewed (...). Sign in again via the HealthRota task pane.

Your sign-in has expired. Sign in again in the task pane.

#VALUE!

Unknown reporting type "...".

Check the type spelling against the task pane's Data type list.

#VALUE!

Unknown field "...". Available: ...

Use one of the fields listed in the message. The Field cells written by the task pane have a dropdown of valid fields.

#VALUE!

Unknown column "...". Available: ...

Use one of the columns listed in the message.

#VALUE!

Invalid filter value ...

The value does not fit the field, such as text in a number field.

When no rows match, the result is the header row only.

Refreshing

The formula runs again when a cell it refers to changes. To get the latest data without changing a cell, select HealthRota > Refresh All on the Home tab.

Related

Did this answer your question?