Xero bill lines in a live spreadsheet
Add the Bill lines table to a sheet as a data source named bill_lines and its 26 columns become names your formulas, pivot tables and charts use. Sheets reads it from your Xero organisation each time the sheet opens or refreshes.
Formulas on this table
=data.bill_lines.sum(quantity) Total quantity. Adds up the Quantity column over every row of Bill lines.
=data.bill_lines.sum(quantity, contact, A2) Quantity per contact. With a contact in A2, the total for that one. Fill it down next to a list of them.
=list.bill_lines(contact) Every contact, once. Spills the distinct contact values down the column: the row labels for the formula above.
=data.bill_lines.sum(quantity, date, ">=2026-01-01") Since a date. Only rows whose Date is on or after 1 January 2026. Criteria such as ">=", "<" and "<>" work as in any spreadsheet.
=data.bill_lines.count(document_id, contact, "<>") Rows with a contact. Counts the rows whose Contact is not empty.
=data.bill_lines.avg(unit_price) Average unit price. avg, min, max, count, countd (distinct) and first work the same way as sum.
Columns
| Column | In formulas | Type |
|---|---|---|
| Document ID | document_id | Text |
| Bill no. | bill_no | Text |
| Date | date | Date |
| Contact | contact | Text |
| Contact ID | contact_id | Text |
| Payment status | payment_status | Text |
| Status | status | Text |
| Description | description | Text |
| Item code | item_code | Text |
| Account code | account_code | Text |
| Account ID | account_id | Text |
| Quantity | quantity | Number |
| Unit price | unit_price | Number |
| Discount % | discount | Number |
| Line amount | line_amount | Number |
| Line amount (excl. tax) | line_amount_excl_tax | Number |
| Line tax | line_tax | Number |
| Tax type | tax_type | Text |
| Amounts are | amounts_are | Text |
| Tracking 1 | tracking_1 | Text |
| Tracking 1 option | tracking_1_option | Text |
| Tracking 2 | tracking_2 | Text |
| Tracking 2 option | tracking_2_option | Text |
| Currency | currency | Text |
| Line ID | line_id | Text |
| Updated at | updated_at | Date and time |
Other purchases tables
Your bill lines, live
Invoices, bills, bank transactions and your monthly profit and loss become tables that formulas, pivots and charts read directly, in your base currency.