Bkper add-on for Google Sheets supports cell formulas. Functions can be used to create formulas that manipulate data to create financial statements on Google Sheets with Bkper data.

Here's a list of all the functions available to fetch financial data from Bkper into Google Sheet, like transactions, accounts and balances.


Use a formula

  1. Install Bkper add-on for Google Sheets.
  2. Open a spreadsheet.
  3. Type an equal sign (=) in a cell and type in the function you want to use. Note: You may see suggested formulas and ranges based on your data.


Bkper functions

  • BKPER_TRANSACTIONS
  • BKPER_BALANCES_PERIOD
  • BKPER_BALANCES_CUMULATIVE
  • BKPER_BALANCES_TOTAL
  • BKPER_ACCOUNTS

Create formula fetching transactions from your Bkper book

Sample usage

=BKPER_TRANSACTIONS("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, "acc:'Bank Account' after:01/2019")
=BKPER_TRANSACTIONS(A10,1, “after:01/2019 before:01/2020”)
  1. Type the name and the syntax of the function.

    Name: BKPER_TRANSACTIONS
    Syntax: =BKPER_TRANSACTIONS (bookId, cache, query)

Explaining the syntax:

  • bookId: string - The universal Book Id.
  • cache: number - Cache-control. Increase to clean cache and force fetch update.
  • query: string - The query.

Create formula fetching balances from your Bkper book (periodic)

  • Fetches periodic account balance values related to a time range.

Sample usage

=BKPER_BALANCES_PERIOD("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1,  “group:'Revenue' after:01/2016 before:01/2017”, TRUE, TRUE, FALSE)
=BKPER_BALANCES_PERIOD(A10, 1,  “acc:'Bank Account' after:01/2019 before:01/2020”, TRUE, TRUE, TRUE)

 

  1. How to create? Type the name and the syntax of the function.

    Name: BKPER_BALANCES_PERIOD
    Syntax: =BKPER_BALANCES_PERIOD (bookId, cache, query, expanded, transposed, hideDates)

Explaining the syntax:

  • bookId: string - The universal Book Id.
  • cache: number - Cache-control. Increase to clean cache and force fetch update.
  • query: string - The query.
  • expanded: TRUE | FALSE - Expand Groups into Account details
  • transposed: TRUE | FALSE - Transpose the result
  • hideDates: TRUE | FALSE - Hide dates row/column

Note:
- 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 a range of time.  
- Useful for P&L

Create formula fetching balances from your Bkper book (cumulative)

Fetches the cumulative account balance value related to a time range.

Sample usage

=BKPER_BALANCES_CUMULATIVE("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, “group:'Assets' after:01/2016 before:01/2017”, TRUE, TRUE, FALSE)
=BKPER_BALANCES_CUMULATIVE(A10, 1, “acc:'Transport' after:01/2019 before:01/2020”, FALSE, TRUE, TRUE)
  1. How to create? Type the name and the syntax of the function.

    Name: BKPER_BALANCES_CUMULATIVE
    Syntax: =BKPER_BALANCES_CUMULATIVE(bookId, cache, query, expanded, transposed, hideDates)

Explaining the syntax:

  • bookId: string - The universal Book Id.
  • cache: number - Cache-control. Increase to clean cache and force fetch update.
  • query: string - The query.
  • expanded: TRUE | FALSE - Expand group accounts
  • transposed: TRUE | FALSE - Transpose the result
  • hideDates: TRUE | FALSE - Hide dates row/column

Note:
- 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 accumulate over the fetched period.
- Useful for Balance Sheets

Create formula fetching balances from your Bkper book (total)

Fetches the total account balance.

Sample usage

=BKPER_BALANCES_TOTAL("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgKD_4bMLDA", 1, “group:'Revenue' after:01/2016 before:01/2017”, TRUE, FALSE, FALSE)
=BKPER_BALANCES_TOTAL(A10, 1, “acc:'Bank Account' ”, FALSE, FALSE, TRUE)
  1. How to create? Type the name and the syntax of the function.

    Name: BKPER_BALANCES_TOTAL
    Syntax: =BKPER_BALANCES_TOTAL(bookId, cache, query, expanded,hideNames)

Explaining the syntax:

  • bookId: string - The universal Book Id.
  • cache: number - Cache-control. Increase to clean cache and force fetch update.
  • query: string - The query.
  • expanded: TRUE | FALSE - Expand group accounts
  • transposed: TRUE | FALSE - Transpose the result
  • hideNames: TRUE | FALSE - Hide account/group names

Note:
- The result is ordered from the largest to the smallest amount.

The bookId parameter can be found in the URL of each book. 

The cache parameter in all the Bkper functions is needed to be able to update itself. With each update this number increases. You can use any value for the cache parameter, but normally 1 is a good reference to start the sequence when you write a Bkper formula.

Create formula fetching accounts from your Bkper book

Fetches accounts from your Bkper book.

Sample usage

=BKPER_ACCOUNTS("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAwLqf-fkIDA", 1)
  1. How to create? Type the name and the syntax of the function.

    Name: BKPER_ACCOUNTS
    Syntax: =BKPER_ACCOUNTS(bookId, cache)

Explaining the syntax:

  • bookId: string - The universal Book Id.
  • cache: number - Cache-control. Increase to clean cache and force fetch update.

Reorder results

Use the Google Sheets Query function with "order by" to reorder Bkper function resultsets.

For example, given a Bkper Function on cell A1, with a resultset on the data range A2:B5, on a different cell, you can reorder it like this:

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

 
Ordering in the query function
asc =  A -> Z
desc = Z -> A

A working Book and Financial Statement as Example

On our template gallery you can copy working examples of Bkper Books and their corresponding Financial Statements in Google Sheets. 

Cells with Bkper formulas are marked grey with a note indicating Bkper Formula on the Financial Statements that comes with the Simple General Ledger Template

The dynamically constructed Queries are marked with a note indicating the cell where it is used in a Bkper formula. 

Video Instructions

6 minute video explaining Bkper Functions

Limitations

Since Bkper Functions are developed with Google Apps Script it is subject to its limitations, which you can find here in more detail. For Bkper functions this translates into a custom function runtime limit of 30 seconds, meaning that you cannot fetch endless amounts of data to your Google Sheets.

In case you cannot fetch the data you need within this limit (such as all your historical transactions) you might want to review your process and see if you can work with balance values only, you can work with smaller time ranges (after: $m-12 before: $m-6) and if you really need to export that much data (back up) you can recur to the export CSV APP.

Troubleshooting

If you have any issues editing the Bkper Functions, please head to this article.

Did this answer your question?