Creating your own functions in Excel

Nov 20
08:53

2008

Dinesh Takyar Dr.

Dinesh Takyar Dr.

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

Creating custom functions in Microsoft Excel can help automate your work.

mediaimage

Today morning it was raining cats and dogs. My good old walking friend called me up and insisted that we must not miss our walk. But I reminded him that it was raining and how! He just would not give up and I gave in. I hate to say 'no' to my friends. Also,Creating your own functions in Excel Articles I thought: let's have some fun in the rain because everybody at home was sleeping anyway. I reached the forest at around 5:45 a. m. And surprise of surprises! All the friends were there. They were all grinning like jackals. I became alert. Now what? What were these guys planning? Now one of them says: You know that guy claims that you can't create your own functions to calculate in Excel. So that's it! Well, that's what good friends are for, isn't it? I explained in detail that you can create a custom function using macros in Microsoft Excel. They almost fainted. Macros! No, they were not interested in programming. So, I promised to send them a 'steamy' video. My friend called up to say that it was a dry steamy video. Nonetheless, he enjoyed it and that he owed me a coffee with the sinful brownie at Cafe Coffee Day!
Here's the custom function I wrote and you can view the video on my website. You start the Visual Basic Editor and enter the following code:
Function paypackage(salary)
'House Rent Allowance (HRA)
'HRA=60% of basic salary,br>
'Leave Travel Allowance (LTA)
'LTA=8.33% of basic salary
paypackage = salary + salary * 0.6 + salary * 0.0833
End Function

This function automatically calculates the paypackage of an employee based on the basic salary that you assign this Employee.