Creating a Function from a 2D Excel Array
In this example, we will demonstrate how to create a 2D array in Excel using the "F+E Mhr.xlsx" file. Specifically, we will show how to look up the value of manhours based on the piping diameter and schedule.
The process is nearly identical to the steps we followed in the previous section for creating a 1D array.
- Go to the ribbon bar and select Tools & Help >> Function Development.
A new dialog box will open. Normally the left panel will be blank.
- Click the +Add button located at the bottom right corner.
A new dialog box will appear. Do the following steps:
- Give a Name to the new function (e.g, MHR).
- Set the Result Type. Select what type of results the function will return. Select Decimal if it returns a number, Text if it returns text, etc. (in our case we select Decimal).
- Set the Grouping (e.g., CEI Functions)
- Click the Add from excel button.
Next
- Select TWO DIMENSIONAL LOOK UP TABLE.
Once selected fill the input arguments and properties aa follow:
- Set the Variable Name.
- Set the Selection List.
- Set the Type/Sort Order.
- Finally select the Create Excel File.
Warning
A variable name should be a single, meaningful word without spaces, starting with either an uppercase or lowercase letter, and it should accurately reflect the variable's purpose
- Select a path where to save it and give a name to the new file.
A new blank excel file will open.
- Copy and paste values (use the F+E Mhr.xlsx file ) and Save.
- Go back to CostOS and click Generate.
The arguments of the new function are now created.
- Click Setup Implementation.
- Drag and drop the MHR argument into the Implementation area and click Add button located at the bottom right corner.
Use the selection list to check if the results are accurate.












