Skip to main content
Back to Functions

XO.PROFIT

Get Net Income (Profit/Loss) from the P&L report for a date range. Returns the bottom line from your Profit & Loss statement. Optionally filter by tracking categories.

Syntax

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

Parameters

ParameterRequiredDescription
org_idYesOrganization ID from XO.ORG()
start_dateYesPeriod 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_dateYesPeriod 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.
category1NoFirst tracking category name
option1NoFirst tracking option
category2NoSecond tracking category name
option2NoSecond tracking option

Returns

  • Positive number = Profit (revenue exceeds expenses)
  • Negative number = Loss (expenses exceed revenue)
  • Zero = Break-even

Examples

Total profit for period:

=XO.PROFIT(A2, C1, D1)

Gets total net income for the date range in C1 to D1.

$32,450

Profit by region:

=XO.PROFIT($A$2, C1, D1, "Region", "North")

Profit by region and department:

=XO.PROFIT(A2, C1, D1, "Region", "North", "Department", "Sales")

Use Cases

Dashboard KPIs

Monthly Profit: =XO.PROFIT(A2, DATE(2025,1,1), DATE(2025,1,31))YTD Profit: =XO.PROFIT(A2, DATE(2025,1,1), TODAY())

Profit Margin Calculation

Revenue: =XO.BALANCE(A2, "4000", C1, D1)Profit: =XO.PROFIT(A2, C1, D1)Margin %: =B3/B2*100

Using [none] as a Tracking Option

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

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

Returns net income for transactions where no Region tracking option is assigned.

  • Calculates: Total Net Income minus Sum of all tracked option Net Incomes
  • Useful for finding untracked P&L impact across your organization
  • Works with both category1/option1 and category2/option2 parameter pairs (one dimension at a time)
  • 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