Excel Functions
Symbols
Before digging into the Functions, let's look at what some Excel symbols represent.
Looking in the function box above, you will see there are all kinds of symbols.
- Pak Accounting is using functions that work with our 3rd party DLL to pull live data from the database. When using the functions, start with an “=” following by the function “name” i.e. wpDescription is the function call that we utilize to pull in account and Sub-Account descriptions. Each function will then have calls in “( )” that ensure the correct information is being pulled in. Each Function and Call will be explained in detail later in the document.
- $ signs in formulas help expedite copying a report definitions without having to constantly change items. The templates provided for the class and to our customers who have Analytics have 3 different uses of the $ signs.
- If a report is being built to have Account numbers in column A, but references to multiple periods or time or companies in subsequent columns a $ before the “A” will allow the formula to be drug down the column and across to other columns without losing the “look” to the “A” column.
i.e. $A13 will allow column A to always be pulled in row 13 regardless of the column the entry is in. If the definition is drug down, the column the formula will look to A13, A14, A15, etc. - If a report is being built to look at the same row, but different columns, the $ sign will need to be between the column letter and the row number.
i.e. E$4 will allow the function to pull the Balance Type that corresponds with the column that is being looked at regardless of what row the function is on in the spreadsheet. If the definition is drug down the column, it will always see E4. If the definition is drug across to another column, it will look to the next column E4, F4, etc. - When the report needs to pull the function from the same cell regardless of the location on the report $ signs before the Column Letter and Row Number will prevent the function call from changing.
i.e. $E$3 will always pull the Company Code defined in E3:

Helpful Tip: Using your F4 key while on the cell will add the $ for you. Keep hitting F4 till you get it set the way you wish. For example: if you select D1 and then hit F4, it will change to $D$1. Hit it again; it’ll change to D$1. One more time will change it to $D1. Hitting it one last time will bring it back to D1. This can save you an incredible amount of time when entering several calls.
There are several other Excel tips and tricks that may be referenced later; however, ensuring that the use of $ signs is understood is critical to reading the functions that already exist in the templates.
Setting ranges, multiple options, and financial groups
To use: | Settings | Example: |
A Range | Separate the first and last desired accounts and/or Sub-Accounts with a forward slash (/) |
Accounts 4000/4110 or |
A Semi-Colon Delimited list | Separate the desired accounts and/or Sub-Accounts with a semi-colon (;). |
Accounts 4000;4010;4011;4100 Or Sub-Accounts NM1;NM2;NM3 |
Multiple Ranges | Each range will be defined with the forward slash within the range and a semi-colon will be placed between the ranges. |
Accounts 4000/4110;5000/5400 Or Sub-Accounts NM1/NM3;TX0001/TX0003 |
A Group | Use the *GRP: selector followed by the Group Sub-Account | *GRP:ALL |
Template Basics
When opening the Small Sample tab of the wpAnalyticsTemplate, notice the information in the green boxes. These are tips and tricks to help your file work correctly. Also, notice that you can keep multiple tabs for different reports all in the same workbook.
Reference Guide for Pak Accounting Analytics can be printed with detailed information and examples on all available functions.
When baking a cake, you start with a recipe. You have a set of ingredients that must be mixed in a certain order for the best results. Functions are much like that – you have a set of criteria that must be followed in a certain order so that you can get the desired outcome. Different functions (recipes) will result in different outcomes (types of desserts). Let’s look at some basic information and learn about our ingredients.
1.This section holds the most information for our formula. It tells the worksheet where to look for company information and the type of information we want. Add a column for each group of information you would like to see. For example, Column E is set to N for Net information, while Column F is set to Y for YTD information.
DBPath | The drive where the Pak Accounting folder is located. This is only used if the data is located on a separate network drive. |
Company | 5-digit code for the company. |
Balance Type | N=Net, Y=YTD, and B=Balance |
Amount Type | Choose between D=Dollar, S=Quantity, B=Budget Dollars, and U=Budget Qty. |
Date Type |
Choose between E=Effective Date or P = Production Date or I=Invoice Date or B=Paid Date Default is Effective Date. |
FYear | Defines the year that the balance will be pulled from Fiscal Year. |
FPeriod | Defines the period/month within the chosen Fiscal Year |
2.Account/Sub-Account and Description
- Enter in the Account Number > Sub-Account (if applicable) to be pulled in. See the Excel Functions section to make dragging/copying easier.
- The Description field is also called the wpDescription function. We will discuss this in more detail shortly.
3.The Amount columns are also called wpGLBalance function. In the example below, these columns are Current Period and YTD. We will discuss this in more detail shortly. Clicking into one of the fields, you can see the fields in the formula box:
Function wpGLBalance
Use the function wpGLBalance to get a balance of an account from the Pak Accounting chart of accounts
(-wpGLBalance will flip the sign and is recommended for accounts that naturally carry a credit balance, i.e. income/liability accounts).
The function wpGLBalance requires 8 parameters to return the balance. The parameters, in order of entry, are:
- Company Code
- Account Number
- Sub-Account
- Balance Type
- Amount Type
- Date Type
- Fiscal Year
- Fiscal Period
There are multiple ways to write the function, so we are going to cover a couple different options. If the report is being written in a manner that would allow the parameters to be changed easily, then the definition will have column/row calls for each of the parameters.
=wpGLBalance(E$3,$A14,$C13,E$4,E$5,E$6,E$7,E$8) | The function will look like this to get the value to pull in E13 and allow the drag down and across to look to different options. |
=wpGLBalance(E$3,$A14,$C13,”N”,”D”,”E”,E$7,E$8) | If the BalanceType will always be net, AmountType will always be dollar, and DateType will always effective and should allow the drag down and across to look to different options the function will look like this. |
NOTE: none of these have referenced the DBPath. This is only required when the WP Data and WP Program are not located on the same server/drive. If you need the DBPath, all functions have ex added to the end of them and the functions first call becomes the DBPath followed by the remaining calls. i.e. =wpGLBalanceex(E$2,E$3,$A14,$C13,E$4,E$5,E$6,E$7,E$8)
Function wpDescription
Use wpDescription to pull the Account description from the Chart of Accounts or the Sub-Account description from Sub-Account Maintenance.
The function wpDescription requires 3 parameters to return the Account, Sub-Account, or Group name. The parameters, in order of entry, are:
- Company Code
- Account Number
- Sub-Account
NOTE: To pull the Account description, use “ “ in Sub-Account field. The Account field must be defined to pull in the Sub-Account description, because the table attached to the account is used to determine which description needs to be pulled in.
=wpDescription(C$3,$A13,” “) | Pull in the Account Description without “hardcoding” any of the function calls. |
=wpDescription(“WPANA”,”4000”,” “) | Pull in the Account Description with “hardcoding” all of the function calls. |
=wpDescription(C$3,$A13,$C13) | Pull in the Sub-Account Description without “hardcoding” any of the function calls. |
=wpDescription(“WPANA”,”4000”,”NM1“) | Pull in the Sub-Account Description with “hardcoding” all of the function calls. |
NOTE: “ “ or “” has to be utilized in the Sub-Account field call location; otherwise, the function will not work.
Function wpAFE
Use wpAFE to pull in AFE information (budget and actual).
The function wpAFE requires 9 parameters to return the balance. The parameters, in order of entry, are:
- Company Code
- Account #
- Sub-Account
- AFE number
- AFE stage
- Balance Type
- Amount Type
- Fiscal Year
- Fiscal Period
=wpAFE(E$3,$A50,$C50,$E50,$F50,"B",G$48,$E$7,$E$8) | To pull the AFE budget with only 1 hardcode (currently the Balance type doesn’t matter, which is why it is hardcoded. |
Function wpGLEffBalance
The wpGLEffBalance will pull the amount based on the from/thru date defined.
The function wpGLEffBalance requires 7 parameters to return the balance. The parameters, in order of entry, are:
- Company Code
- Account Number
- Sub-Account
- Balance Type
- Amount Type
- From Date
- Thru Date
=-wpGLEffBalance(D$63,$A70,$C70,D$64,D$65,D$66,D$67) | To pull the data without any hardcodes “-“ is being used to flip the signs. |
=-wpGLEffBalance(D$63,$A70,$C70,”N”,”D”,D$66,D$67) | To pull the data with the Balance Type and Amount Type hardcoded. “-“ is being used to flip the signs. |
Function wpGLDeckBalance
Use this function to pull in balances at the deck level for Revenue and Billing type accounts.
The function requires 9 parameters to return the value. The parameters, in order of entry, are:
- Company Code
- Account Number (must be Revenue or Billing Type account)
- Property Number
- Deck (blank signifies blank deck vs all decks)
- Balance Type (N = Net, Y = YTD, and B = Balance)
- Amount Type (E = Effective Date or P = Production Date)
- Date Type (E = Effective Date or P = Production Date)
- From Date (MM/DD/YYYY) if left blank will assume beginning of time.
- Thru Date (MM/DD/YYYY) if left blank will assume end of time.
=wpGLDeckBalance($B$1,$A5,$C5,$E5,$F5,G$3,$B$2,$E$1,$E$2) | To pull the data without any hardcodes |
Function wpDeckInfo
Use this function to pull in Division of Interest details for a specific deck that may be used in conjunction with wpGLDeckBalance for additional analysis.
The function requires 11 parameters to return the value. The parameters, in order of entry are:
- Company Code
- Property Number
- Deck (blank signifies blank deck vs all decks)
- Owner AR account # (will pull in billing deleted interest account or other non-AR account that could be attributed to the DOI Deck)
- Owner Number (In most cases this will be the Owner Number, but it could be Property Number)
- Interest Type (Typically W=Working, R=Royalty, O=Override, C=Carried, and P=Production Payment, but could also contain a number if there are multiple interest for the same owner for the same interest type on a specific DOI Deck) if left blank the owner must only appear on the deck once in order to pull the correct decimal interest
- Suspense Code (Pay or Legal – if L with no additional distinction is used all legal suspense will pull)
- Account # (Revenue or Billing Account Number)
- Value (S=Suspense Code, B=Billing Decimal Interest, R=Revenue Decimal Interest, or D=Deleted Interest (display Y/N for the account defined)) *
- Effective Date (MM/YYYY) if left blank will assume end of time
- Include Option (D=Deleted Interest)
* If owner is exempt for the account the Billing/Revenue Decimal Interest for the exempt account(s) will return 0.000000000. If there is an exempt interest on the deck the owners that are not exempt will have the decimal interest display with the carried decimal interest. This will allow the user to multiply the answer in the wpGLDeckBalance by the wpDeckInfo interest to calculate the value for the owner.
=wpDeckInfo(G$1,$A9,$B9,$C9,$D9,$E9,$F9,G$2,G$3,G$4,G$5) | To pull the data without any hardcodes |