Portfolio workbook guide

Build an IBKR portfolio dashboard in Excel for Mac

Combine account values, live positions, cost basis, session P&L, and market data from your local TWS or IB Gateway session in one workbook.

=XN.ACCOUNTS()
=XN.ACCOUNT("U12345","NetLiquidation")
=XN.ACCOUNT("U12345","BuyingPower")
=XN.PNL("U12345","daily")
=XN.POSITIONS("U12345")

Dashboard model

Use separate formulas for separate workbook jobs

XLNative keeps account discovery, account summary values, positions, cost basis, P&L, and market prices in focused functions. That lets you place each value where it belongs while Excel handles presentation, calculations, charts, and scenario logic.

A practical workbook structure

Account header

Discover the account ID, then display net liquidation, buying power, available funds, and excess liquidity.

Session P&L

Show daily, realized, or unrealized P&L at account level or for a specific symbol.

Positions table

Spill nonzero positions with symbols, position sizes, and cost basis into a live table.

Market columns

Add last, bid, ask, close, IV, or other market fields beside the holdings you want to monitor.

Start by discovering the visible account

Enter =XN.ACCOUNTS() first. Use the returned account ID in the account, P&L, position, cost-basis, and positions-table functions. Keeping the account ID in one worksheet cell makes it easy to reference from the rest of the workbook.

=XN.ACCOUNTS()
=XN.ACCOUNT("U12345","NetLiquidation")
=XN.ACCOUNT("U12345","BuyingPower")
=XN.PNL("U12345","daily")
=XN.POSITIONS("U12345")

Understand the update sources

Market values update from IBKR market-data subscriptions. P&L uses IBKR's P&L subscription. Position size and cost basis update from the active local session. Account-summary values follow IBKR's account-summary update schedule, which is typically slower than quote updates.

XLNative reads the data available to your local TWS or IB Gateway session. It does not require your IBKR username or password and does not relay the workbook data through a Trelliq Labs cloud service.

Build the smallest useful dashboard first

Start with one account value, account-level daily P&L, and the live positions table. Confirm those values update, then add market columns and your own workbook calculations.