Excel functions calculate the debt age and the average balance
Debt accountants often have to calculate the age of accounts receivable of customers to know which account should be collected in advance, in addition to calculate the average balance of these receivables to " improve the quality of financial management. ". If there is no accounting software that provides these functions or has to work with Excel manually, I guarantee you will feel that the life of the accountant is no different from "eternity". The following two Excel functions can help you quickly regain the feeling of love.
For example, we have a customer data sheet as shown below
• The first column is the date of transaction with the customer (sorted by increasing date)
• The second column is the amount of receivables from customers (debiting)
• The third column is the number obtained by the customer (credited)
• The fourth column is the second column except the third column
• The fifth column is balanced and receivable after each transaction, column 6 is a note
Calculations only need columns 1 to 4.
Create function
1. Function OldOfDebt (mRange As Range, toDate As Date) As Double
This function returns the age of the receivables by date, by answering the outstanding receivables at the last day of receivables of which days the principle that the collected amount will be paid for the receivables to first, then calculate the number of days by weight of each item for the balance.
The function has two parameters, the first mRange is the calculation area, in the example is A2: D13; second toDate is the date to determine the age (toDate must be greater than the last day of the transaction with the customer), in the picture is C19. For example, the calculation of the age of accounts receivable is 191,000 and is 146.36 days returned in cell E19.
2. Function AvgBalance (mRange As Range, toDate As Date) As Double
This function has the same parameter as the upper function, returning the average receivable balance of customers by the proportion of time. In the figure, the function calculates the average balance returned to cell E21 is 106.791 with mRange is A2: D13 and toDate is December 31, 2005. (You can calculate the loss that this customer occupies with the interest rate function in the interval A2 to A13).
Source code
Public Function OldOfDebt (mRange As Range, toDate As Date) As Double
Dim rDate As Range Cot now
Dim rDebit As Range Cot recorded no
Dim rCredit As Range Cot record co
Dim mPaid As Double Tong compared to skin
Dim mClose As Double So far, right toDate
Dim mAccDebit As Double Debit cong don
Dim thisAmount As Double
Dim thisDate As Double
Dim mRow As Long Bien
Dim i As Long
Dim ret As Double Click on the link
mRow = mRange.Rows.Count
Set rDate = mRange.Range (Cells (1, 1), Cells (mRow, 1))
Set rDebit = mRange.Range (Cells (1, 2), Cells (mRow, 2))
Set rCredit = mRange.Range (Cells (1, 3), Cells (mRow, 3))
mPaid = Application.WorksheetFunction.Sum (rCredit)
mClose = Application.WorksheetFunction.Sum (rDebit) - Application.WorksheetFunction.Sum (rCredit)
For i = 1 To mRow
If rDebit.Cells (i, 1) .Value <> 0 Then
mAccDebit = mAccDebit + rDebit.Cells (i, 1) .Value
If mAccDebit> mPaid Then
thisAmount = Application.WorksheetFunction.Min (mAccDebit - mPaid, rDebit.Cells (i, 1) .Value)
thisDate = rDate.Cells (i, 1) .Value
ret = ret + thisAmount * (toDate - thisDate) / mClose
End If
End If
Next i
OldOfDebt = ret
End Function
Public Function AvgBalance (mRange As Range, toDate As Date) As Double
Dim rDate As Range
Dim rAmount As Range
Dim mRow As Long
Dim mLenght As Long is busy to work right away
Dim i As Long
Dim ret As Double
mRow = mRange.Rows.Count
Set rDate = mRange.Range (Cells (1, 1), Cells (mRow, 1))
Set rAmount = mRange.Range (Cells (1, 4), Cells (mRow, 4))
mLenght = toDate - rDate.Cells (1, 1)
For i = 1 To mRow
ret = ret + rAmount.Cells (i, 1) * (toDate - rDate.Cells (i, 1)) / mLenght
Next i
AvgBalance = ret
End Function
Nguyen Van Thang
Email : thang_via@yahoo.com
You should read it
- How to split cells, combine cells in Excel
- Merge cells in Excel
- How to split cells, combine cells (cells) in Word table
- COUNTBLANK function - Count the number of blank (empty) cells in a selected range or array in Excel
- Two new types of blood cells were discovered
- The Match function (the function searches for a specified value in an array or cell range) in Excel
- How to color formula cells in Excel automatically
- The OFFSET function returns a reference in Excel
May be interested
- VDB function - Calculate asset depreciation by the declining balance method in Excelthe following article details the meaning and usage of the vdb function - calculating depreciation of fixed assets in excel.
- Date time functions in Excelexcel supports you to process and calculate quickly with the functions that excel provides such as calculation functions, date functions ... one of them is the function of time to help you handle the prices. time value: hour, minute, second conveniently
- Calculation of percentages in Excelcalculating percentages in excel is a basic calculation, with a very simple and quick calculation when you don't need to enter any functions.
- Date functions in Excel, DAY, WEEKDAY, MONTHdo you want to automatically update the current date, separate years or calculate the distance between two time points? the article below, free download will guide you how to do this professionally with date functions in excel.
- How to use the kernel function (PRODUCT function) in Excelin excel, product helps users to calculate product values, multiply arguments together, and return their results correctly.
- Common calculation functions in Excel, formulas and examplescommon calculation functions in excel not only help you process data quickly but also increase the accuracy of calculations. let's learn about the sum, average, max, min functions with free download to improve work efficiency.
- How to use AVERAGEIFS function on Excelthe averageifs function on excel will calculate the average of the values, but with many other conditions.
- How to use NORMDIST function in Excelnormdist is a function that returns a distribution with a standard deviation and a confirmed average. the normdist function applies in statistics, including hypothesis testing.
- How to fix the SUM function doesn't add up in Excelin the process of summing with sum in excel, you will encounter some errors such as not jumping the number, not adding the sum. so how to handle this problem?
- How to Calculate Average Growth Rate in Excelaverage growth rate is a financial term used to describe a method of projecting the rate of return on a given investment over a period of time. by factoring the present and future value of a particular investment in relationship to the...