Technical Details of UDF/Parallel Model Concept

This page describes some of the details of developing the UDF and the parallel model. We have structured the parallel model so that it is like open source programming where you can add your own modifications and you may even hopefully share your work. The idea is to create a model that parallels your model so that you can avoid copy and paste routines and so you can work in complex things like multiple sculpting issues with curved DSCR’s that meet a minimum requirement. The of philosophy our structure is to give you a template that has a whole bunch of the calculations and formulas. But there is no doubt that you may want to add something or adjust something. For example, you may want to change the way VAT refunds are assumed. If you understand some of the key items you can then implement the concepts using the more comprehensive template model. On this page we begin by illustrating a couple of very simple case. The different examples illustrate how you can read in variables; make some arithmetic calculations to mimic the circular reference calculations; and output the results back to excel.

Start with Report, then Construct Inputs and then Equations

Make separate modules with reports and equations.

Reading, Arithmetic and Writing

Any program that you write whether in Excel, C++, Fortran, VBA or Python has inputs, some kind of process and outputs. In working with Hedieh we have recognized that being really flexible with reading and writing are essential. In terms of the Arithmetic, the idea is to just copy what you are doing in excel.

Simple Parallel Model Case

Reading and Writing Variables

I work through a simple example with fees in project finance or interest expense in corporate finance. In these examples, I show how you should read in the variables. This is fine for small applications.

The UDF must read a lot of variables and write out the variables in an efficient manner. Excel has a limit of reading ____ characters into the UDF. If you have a complex circular reference problem, there will be two problems

Note in the example below that the read_data is not defined as a particular type of an array.

Function UDF_test(read_data)

Column_test = read_data.Columns.Count
For i = 1 To Column_test 
   read_data_test(i) = read_data(i) 
Next i

UDF_test = output_test
End Function