XO.BUDGET
Get budget amount for an account over a date range. Use for variance analysis (Actual vs Budget).
Syntax
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.
Need a different budget?
The Budget Summary report only shows your Overall Budget. The =XO.BUDGET() formula can pull any budget you've set up in Xero: your Overall Budget, a separate forecast, or a budget for a specific team or region. Just type the budget's name exactly as it appears in Xero.
Examples
Overall company budget:
=XO.BUDGET(A2, "Overall Budget", "4000", C1, D1)Gets the budget amount for account 4000 from the Overall Budget.
Tracking budget by region:
=XO.BUDGET(A2, "FY2024 North Region", "4000", C1, D1)Variance Analysis Example
Start this table at A1. Put the Org ID in F1, the start date in F2, and the end date in F3, outside the table.
| Account | Actual | Budget | Variance |
|---|---|---|---|
| 4000 | =XO.BALANCE($F$1,"4000",$F$2,$F$3) | =XO.BUDGET($F$1,"Overall Budget","4000",$F$2,$F$3) | =B2-C2 |
| 6200 | =XO.BALANCE($F$1,"6200",$F$2,$F$3) | =XO.BUDGET($F$1,"Overall Budget","6200",$F$2,$F$3) | =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, both dates are required to retrieve budget periods
- Budget amounts are summed across all months touched by the specified date range, without prorating partial months
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 - Partial months: A date range within a month returns that whole month's budget
Troubleshooting
If you see an error, check the troubleshooting guide. XO Report shows standard Excel errors (#VALUE!, #N/A) for connection and data problems. To show a blank or your own message instead of an error, wrap the formula in IFERROR. Hover over the cell to see the specific message.
For a complete overview of building Xero reports in Excel, including how this function fits into a full workflow, see our complete Xero to Excel guide.