Skip to main content
Back to Functions

XO.BALANCE

Get the balance for a single GL account. For P&L accounts, returns activity between dates. For Balance Sheet accounts, returns balance as of end date.

Syntax

=XO.BALANCE(org_id, account, start_date, end_date, [category1], [option1], [category2], [option2])

Parameters

ParameterRequiredDescription
org_idYesOrganization ID from XO.ORG()
accountYesGL account code (e.g., "4000")
start_dateYesPeriod start date (cell reference)
end_dateYesPeriod end date (cell reference)
category1NoFirst tracking category name (e.g., "Region")
option1NoFirst tracking option (e.g., "North")
category2NoSecond tracking category name
option2NoSecond tracking option. Leave blank to include all transactions (no filter).

P&L vs Balance Sheet Accounts

  • P&L accounts (Revenue, Expense): Returns activity between start_date and end_date
  • Balance Sheet accounts (Asset, Liability, Equity): Returns balance AS OF end_date - the start_date is ignored

Examples

Basic usage:

=XO.BALANCE(A2, "4000", C1, D1)

Gets revenue for account 4000 for the date range in C1 to D1.

$124,500

With tracking filter:

=XO.BALANCE($A$2, "6200", C1, D1, "Region", "North")
Gets expenses for account 6200, filtered by Region = North.

Two tracking categories:

=XO.BALANCE(A2, "6200", C1, D1, "Region", "North", "Project", "Alpha")
Filter by both Region and Project tracking categories.

Sign Convention

XO.BALANCE automatically returns amounts with intuitive signs - you don't need to think about debits and credits:

Account TypeResult
RevenuePositive when you earn money
ExpensePositive when you spend money
AssetsPositive when normal debit balance
LiabilitiesPositive when normal credit balance
EquityPositive when normal credit balance

Using [none] as a Tracking Option

You can pass [none] as a tracking option value to retrieve the balance for transactions that have no tracking category assigned:

=XO.BALANCE(A2, "4000", C1, D1, "Region", "[none]")

Returns revenue for account 4000 where no Region tracking option is assigned.

  • Useful for finding transactions not assigned to any tracking category
  • Works with both category1/option1 and category2/option2 parameter pairs
  • Note: There may be a performance impact when using [none] as it requires additional API calls

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.

Related Functions