Create aging / bucketing using custom aging function. just copy and paste the following code in your excel and create aging very easily
Step 1. Copy the below given VBA Function
Step 2. Create a new sheet, go to VBA editor and insert a new module
Step 3. Paste the copied function in the module
Step 4. Change the bold text given in all lines with greater than or less than symbol as per requirement
Step 5. Test the function (currently it is available in the current active workbook only)
Step 6. To enable the function to work on all the workbooks, save as your file with excel file type Excel Add - in (.XLAM)
Step 7. Click on file menu and go to the option, then select Add - Ins, after selecting add-ins, you will find multiple function available there, select the Aging Function and then click on the Go button
Step 8. A pop up windows will option with few function, you need to selection the Aging Function and then click ok
Your Function is ready to use in all workbooks / Excel files
Function aging(cells As Integer, cells1, cells2, cells3, cells4, cells5 As Integer, text As String) As String
Select Case cells
Case Is is less than = cells1
aging = cells1 - cells1 & " - " & cells1 & " " & text
Case Is is less than = cells2
aging = cells1 + 1 & " - " & cells2 & " " & text
Case Is is less than = cells3
aging = cells2 + 1 & " - " & cells3 & " " & text
Case Is is less than = cells4
aging = cells3 + 1 & " - " &
cells4 & " " & text
Case Is is less than = cells5
aging = cells4 + 1 & " - " & cells5 & " " & text
Case Is is greater than = cells5
aging = "is greater than " & cells5 & " " & text
End Select
End Function
Link to my other related videos
How to create your own custom defined Function using VBA Editor
• How to create your own custom defined Func...
How to use Excel add in file format to save your custom defined functions
• Use of Excel Add-Ins File Format, save you...
How to create aging using IF function
• How to create aging / Bucketing using IF F...