Creating a Function from a 1D Excel Array

In this example, we will demonstrate how to create a 1D array in Excel.

  1. Go to the ribbon bar and select Tools & Help >> Function Development.

Ribbon Bar

A new dialog box will open. Normally the left panel will be blank.

  1. Click the +Add button located at the bottom right corner.

Function Add Button

A new dialog box will appear. Do the following steps:

  1. Give a Name to the new function (e.g, WEIGHT).
  2. 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).
  3. Set the Grouping (e.g., CEI Functions)

Set up Declaration Window

  1. Click the Add from excel button.

Function Add From Excel Button

Next

  1. Select ONE DIMENSIONAL LOOK UP TABLE.

One Dimensional Window

Once selected fill the input arguments and properties aa follow:

  1. Set the Variable Name.
  2. Set the Selection List.
  3. Set the Type/Sort Order.
  4. Finally select the Create Excel File.

Create One Dimensional Table

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

  1. Select a path where to save it and give a name to the new file.

Create Excel File One Dimension

A new blank excel file will open.

Empty Excel Sheet One Dimension

  1. Copy and paste values (use the IPE sections weight.xlsx file) and Save.

Filed With Values Excel Sheet One Dimension

  1. Go back to CostOS and click Generate.

Empty Excel Sheet One Dimension

The arguments of the new function are now created.

New Function One Dimension

  1. Click Setup Implementation.

Implementation Button

  1. Drag and drop the WEIGHT argument into the Implementation area and click Add button located at the bottom right corner.

Drag and Drop One Weight Argument