The Visual Basic programming language allows us to create custom functions specific to our needs.
Have you ever been faced with wanting to use a function that is incompatible with your version of Excel? Or wanting to use an existing function without it having the exact parameters, desired behavior, or to simplify a combination of nested formulas?
For example, if we wanted to calculate the commission obtained on a sale according to the department, we could create this function:
Thus, we use in our table the amount of the sale as well as the department number. For the home appliances department, the commission is 4% unlike furniture and mattresses which are respectively 2% and 1%.
Another example;
We want to automatically assign teams of female and male players based on their age. We have 4 teams; two women’s teams and two men’s, for the under 18s and over 18s.
Custom functions therefore offer great flexibility to facilitate your calculations without having to use long formulas.