Functions in Excel

 

Steps to success:

1. Start a new Excel worksheet


2. Select Tools > Macro > Visual Basic Editor (see frame below)

 



3. You will get the Visual Basic Editor, you may or may not have a module already. If not, choose Insert > Module

You should then get a blank module screen. Type what is shown in the frame below


4. Note that the word "Function" and words "End Function" are in a different color. They are reserved words in Visual Basic and have special meaning.

 


5. The function is named "Add3" and requires three inputs: a, b, c, and returns the sum of those numbers.

 

6 Choose File > Close Visual Basic and return to the Excel worksheet

 

7 Enter some numbers in  cells A1, B1, and C1 then move down to, say B3 and click the paste function  button "f(x)" on the toolbar. The paste function dialog box should come up. Select User Functions and select the function you just made (Add3) as shown in the next frame:

 



8. Now you just have a good old function in Excel like always. The wizard will lead you
through the inputs and so on: