Skip to content

Bkper Functions

Reference for all Bkper custom functions in Google Sheets — balance functions for financial statements and data functions for listing records.

Bkper Functions fetch data from your Bkper Books directly into Google Sheets. The functions stay connected to your Books, so any updates in Bkper are automatically reflected in your spreadsheet.

If you are new to Bkper or not very familiar with Google Sheet functions, the Add-on Sidebar wizard can create the formulas for you.

How to Use

Install the Bkper Add-on, open a spreadsheet, and type an equal sign (=) followed by the function name. Google Sheets suggests available Bkper functions as you type.

Google Sheets autocomplete showing available Bkper functions

Function Categories

Bkper offers two types of functions:

Balance Functions — Fetch aggregated balance values for reporting:

Data Functions — Fetch lists of records with full details:

Common Parameters

All Bkper Functions share two common parameters:

bookId — The unique identifier for your Bkper Book. You can find this in the Book URL or copy it from the Add-on Sidebar. Learn more about finding your Book ID.

cache — A number used to control caching. Increase this value to force a fresh data fetch from Bkper.

Update Reports

Press Update from the Bkper extension menu to fetch the latest values from your Bkper Book into all Bkper Functions on your Sheet.

Bkper Update option in the Extensions menu of Google Sheets

The Update function works by incrementing the cache parameter on all Bkper functions in your Sheet, forcing them to fetch fresh data.

Bkper function showing the cache parameter being incremented after update

Balance Functions

These functions return balance values and are ideal for building financial statements.

FunctionPurposeSyntax
BKPER_BALANCES_TOTALTotal balance for a period=BKPER_BALANCES_TOTAL(bookId, cache, query, expanded, transposed, hideNames)
BKPER_BALANCES_PERIODBalance per period (monthly, yearly)=BKPER_BALANCES_PERIOD(bookId, cache, query, expanded, transposed, hideDates)
BKPER_BALANCES_CUMULATIVERunning balance over time=BKPER_BALANCES_CUMULATIVE(bookId, cache, query, expanded, transposed, hideDates)
BKPER_BALANCES_TRIALDebit and credit columns=BKPER_BALANCES_TRIAL(bookId, cache, query, expanded, transposed, hideNames)

In addition to bookId and cache, all balance functions share these parameters:

ParameterTypeDescription
querystringThe query to filter results
expandedTRUE, FALSE, or numberExpand Group tree. TRUE expands the Group itself, -1 expands all subgroups, -2 expands all Accounts, any other number expands up to that level
transposedbooleanTRUE to transpose the result

The sixth parameter varies by function — either hideNames or hideDates — and is documented under each function below.

BKPER_BALANCES_TOTAL

Fetch the total balance values from Accounts and Groups.

=BKPER_BALANCES_TOTAL(bookId, cache, query, expanded, transposed, hideNames)
ParameterTypeDescription
hideNamesbooleanTRUE to hide Account/Group names

Example:

=BKPER_BALANCES_TOTAL("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "group:'Revenue' after:01/2016 before:01/2017", TRUE, FALSE, FALSE)

The result is ordered from the largest to the smallest amount.

BKPER_BALANCES_PERIOD

Fetch periodic balance values from your Bkper Book. Returns Account balance values broken down by time period.

=BKPER_BALANCES_PERIOD(bookId, cache, query, expanded, transposed, hideDates)
ParameterTypeDescription
hideDatesbooleanTRUE to hide the dates row/column

Example:

=BKPER_BALANCES_PERIOD("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "group:'Revenue' after:01/2016 before:01/2017", TRUE, TRUE, FALSE)
  • The result is ordered by Account names.
  • If not referenced in the query, the default period is monthly.
  • The periodic balance values are fetched for the debits/credits in the specified time range.
  • Useful for Profit & Loss statements.

BKPER_BALANCES_CUMULATIVE

Fetch cumulative Account balance values from your Bkper Book. Returns running balances over a time range.

=BKPER_BALANCES_CUMULATIVE(bookId, cache, query, expanded, transposed, hideDates)
ParameterTypeDescription
hideDatesbooleanTRUE to hide the dates row/column

Example:

=BKPER_BALANCES_CUMULATIVE("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "group:'Assets' after:01/2016 before:01/2017", TRUE, TRUE, FALSE)
  • The result is ordered by Account names.
  • With Asset and Liability Account types, the balance value of the previous period is considered.
  • With Incoming and Outgoing Account types, the balance value starts at 0 and accumulates over the fetched period.
  • Useful for Balance Sheets.

BKPER_BALANCES_TRIAL

Fetch the trial balance values from Accounts and Groups, showing debit and credit columns.

=BKPER_BALANCES_TRIAL(bookId, cache, query, expanded, transposed, hideNames)
ParameterTypeDescription
hideNamesbooleanTRUE to hide Account/Group names

Example:

=BKPER_BALANCES_TRIAL("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "group:'Revenue' after:01/2016 before:01/2017", TRUE, FALSE, FALSE)

Data Functions

These functions return complete record listings. All available data is included automatically — IDs, Groups, and Custom Properties are always fetched, making the functions simpler to use.

BKPER_ACCOUNTS

Fetch the Chart of Accounts from your Bkper Book into Google Sheets. Returns a complete listing of Accounts with their types, Group memberships, and Custom Properties.

=BKPER_ACCOUNTS(bookId, cache, group)
ParameterTypeDescription
groupstring (optional)Filter Accounts by a specific Group name or Group ID

Examples:

Fetch all Accounts:

=BKPER_ACCOUNTS("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1)

Fetch only Accounts in the “Expenses” Group:

=BKPER_ACCOUNTS("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "Expenses")

Output Columns

ColumnDescription
Account IdUnique identifier for each Account
NameAccount name
TypeAccount type: ASSET, LIABILITY, INCOMING, or OUTGOING
Group columnsOne column per Group in your Book, showing Group membership
Custom PropertiesAny Custom Properties defined on the Accounts

The optional group parameter fetches only Accounts belonging to a specific Group. You can pass either the Group name or the Group ID. If the Group has child Groups, Accounts from all child Groups are also included in the result.

Accounts are sorted first by type (Asset, Liability, Incoming, Outgoing), then alphabetically by name within each type.

BKPER_GROUPS

Fetch all Groups from your Bkper Book into Google Sheets. Returns a complete listing of Groups with their hierarchy, Account counts, and Custom Properties.

=BKPER_GROUPS(bookId, cache)

Example:

=BKPER_GROUPS("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1)

Output Columns

ColumnDescription
Group IdUnique identifier for each Group
NameGroup name
TypeGroup type: ASSET, LIABILITY, INCOMING, OUTGOING, or mixed types
ParentName of the parent Group, if any
ChildrenNumber of child Groups
AccountsNumber of Accounts in the Group
Custom PropertiesAny Custom Properties defined on the Groups

Group Types

Groups can have single or mixed types:

TypeDescription
ASSETGroups containing only Asset Accounts
LIABILITYGroups containing only Liability Accounts
INCOMINGGroups containing only Incoming Accounts
OUTGOINGGroups containing only Outgoing Accounts
ASSET_LIABILITYGroups that can contain both Asset and Liability Accounts
INCOMING_OUTGOINGGroups that can contain both Incoming and Outgoing Accounts

Groups are sorted hierarchically — parent Groups appear first, followed by their children. Within each level, Groups are sorted by type and then alphabetically by name.

BKPER_TRANSACTIONS

Fetch Transactions from your Bkper Book into Google Sheets. Returns all Transactions matching your query, with full details including IDs, status, Custom Properties, and attachments.

=BKPER_TRANSACTIONS(bookId, cache, query)
ParameterTypeDescription
querystringThe query to filter Transactions

Example:

=BKPER_TRANSACTIONS("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "acc:'Bank Account' after:01/2019")

Output Columns

ColumnDescription
Transaction IdUnique identifier for each Transaction
StatusCurrent state: DRAFT, UNCHECKED, CHECKED, or TRASHED
DateTransaction date
OriginThe Account where the amount comes from
DestinationThe Account where the amount goes to
DescriptionTransaction description
AmountTransaction amount
BalanceRunning balance (only when filtering by a permanent Account)
Recorded atDate and time the Transaction was recorded
Custom PropertiesAny Custom Properties on the Transaction
Remote IdsExternal system identifiers, if any
AttachmentsURLs or file attachments linked to the Transaction

Transaction Status

Each Transaction has one of four status values:

StatusDescription
DRAFTTransaction recorded but not yet posted
UNCHECKEDTransaction posted but not yet verified
CHECKEDTransaction posted and verified
TRASHEDTransaction moved to trash

You can filter by status in your query using is:draft, is:unchecked, is:checked, or is:trashed.

Balance Column

The Balance column only appears when your query filters by a single permanent Account (Asset or Liability). It shows the running balance of that Account at each Transaction.

This query will include the Balance column:

=BKPER_TRANSACTIONS(bookId, 1, "acc:'Bank Account'")

This query will not include Balance (filtering by a non-permanent Account):

=BKPER_TRANSACTIONS(bookId, 1, "acc:'Office Supplies'")

Reorder Results

Use the Google Sheets QUERY function to reorder Bkper function results. For example, given a Bkper function result in the range A2:B5:

=QUERY(A2:B5, "Select A, B order by A desc")

asc = A to Z (ascending) | desc = Z to A (descending)

Working Examples

The template gallery contains working examples of Bkper Books with corresponding Financial Statements in Google Sheets.

In the Financial Statements that accompany the Simple General Ledger Template, cells with Bkper formulas are marked grey with a note indicating Bkper Formula.

Video Instructions

6 minute video explaining Bkper Functions

Limitations

Bkper Functions use Google Apps Script, which has a 30-second runtime limit per function call. This means you cannot fetch unlimited amounts of data in a single function.

If you hit this limit, consider:

  • Using balance functions instead of fetching all Transactions
  • Narrowing your time range (e.g., after:$m-12 before:$m-6)
  • Using the CSV Export App for large data exports

See the full Google Apps Script quotas for more details.

Troubleshooting

For issues with Bkper Functions, see Known Issues.