1 Open an Excel workbook. Double-click the workbook in which you want to use the custom-defined function to open it in Excel. 2 Press Alt + F11 (Windows) or Fn + ⌥ Opt + F11 (Mac). This opens the Visual Basic Editor. 3 Click the Insert menu and select New Module . This opens a module window in the right panel of the editor. [1] You can create the user defined function in the worksheet itself without adding a new module, but that will make you unable to use the function in other worksheets of the same workbook. 4 Create your function's header. The first line is where you will name the function and define our range. [2] Replace "FunctionName" with the name you want to assign your custom function. The function can have as many parameters as you want, and their types can be any of Excel's basic data or object types as Range: Function FunctionName ( param1 As type1 , param2 As type2 ) As ret...