Back to Functions
XO.BUDGET
Get budget amount for an account over a date range. Use for variance analysis (Actual vs Budget).
Syntax
=XO.BUDGET(org_id, budget_name, account, start_date, end_date)
Parameters
| Parameter | Required | Description |
|---|---|---|
| org_id | Yes | Organization ID from XO.ORG() |
| budget_name | Yes | Budget name as defined in Xero (e.g., "FY2024 Budget") |
| account | Yes | GL account code (must be P&L account) |
| start_date | Yes | Period start date. Must be a cell reference containing a date (e.g., C1) or an Excel serial date number. Typed text dates like '2024-01-01' will cause an error. |
| end_date | Yes | Period end date. Must be a cell reference containing a date (e.g., D1) or an Excel serial date number. This ensures dates work correctly across all locale settings. |
Budget Types in Xero
- OVERALL budgets- Company-wide budgets (e.g., "FY2024 Budget", "FY2025 Forecast")
- TRACKING budgets- Per-region or per-department budgets (e.g., "FY2024 North Region")
Note: Xero budgets only apply to P&L accounts (Revenue and Expense). Balance Sheet accounts do not support budgets.
Examples
Overall company budget:
=XO.BUDGET(A2, "Overall Budget", "4000", C1, D1)Gets the budget amount for account 4000 from the Overall Budget.
$95,000
Tracking budget by region:
=XO.BUDGET(A2, "FY2024 North Region", "4000", C1, D1)Variance Analysis Example
| Account | Actual | Budget | Variance |
|---|---|---|---|
| 4000 | =XO.BALANCE(A2,"4000",C1,D1) | =XO.BUDGET(A2,"Overall Budget","4000",C1,D1) | =B2-C2 |
| 6200 | =XO.BALANCE(A2,"6200",C1,D1) | =XO.BUDGET(A2,"Overall Budget","6200",C1,D1) | =B3-C3 |
How It Works
- XO.BUDGET fetches the named budget from Xero and returns the total for the specified account within the date range
- For tracking-category budgets, the date range must exactly match budget periods for correct retrieval
- Budget amounts are summed across all periods that fall within the specified date range
Errors
- Budget not found: Returns
#VALUE!if the budget name doesn't exist in Xero - No data: Returns
0if the account has no budget amount in the specified period - Tracking budgets: Using misaligned date ranges may return incorrect totals
Troubleshooting
If you see an error, check the troubleshooting guide. XO Report shows readable guidance messages for connection issues (not caught by IFERROR) and standard Excel errors (#VALUE!, #N/A) for data problems — hover over the cell to see the specific message.