Skip to main content

Free for 14 days · from $9.90/mo

See plans
Only in ExcelGoogle Sheets has no custom formulas. Use tables and reports there.
Back to Functions

XO.LACCOUNT

Lookup a property of a GL account by account code. Returns name, type, class, status, description, or tax type.

Syntax

=XO.LACCOUNT(org_id, account_code, property)

Parameters

ParameterRequiredDescription
org_idYesOrganization ID from XO.ORG()
account_codeYesGL account code (e.g., "4000")
propertyYesProperty to return (0-5, see table below)

Property Options

CodePropertyDescription
0nameAccount name (e.g., "Sales - General")
1typeAccount type (BANK, CURRENT, FIXED, etc.)
2classAccount class (ASSET, LIABILITY, REVENUE, EXPENSE, EQUITY)
3statusAccount status (ACTIVE, ARCHIVED)
4descriptionAccount description
5taxTypeTax type code

Examples

Get account name:

=XO.LACCOUNT(A2, "4000", 0)

Returns the name of account 4000.

Sales

Get account class:

=XO.LACCOUNT($A$2, "200", 2)

Get account type:

=XO.LACCOUNT(A2, "800", 1)

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.

Related Functions