Formula Questions for Enterprise Project Fields in 2003

A

Allison

A consultant created these formulas for me and I don't know what they mean.
Would one of you VBA experts please make a stab at interpreting these two
formulas, please.

IIf([Baseline Start]/50000000>10,"Not Baselined",IIf([Baseline Start]<Date()
And [Actual Start]/50000000>10,"Should Have Started",""))

IIf([Finish]=[Actual Finish],-9999,IIf([Baseline
Finish]/50000000>10,-9998,(projdatediff([Baseline Finish],[Finish])/480)))
 
J

Jack Dahlgren

It means exactly what it says :)
Your consultant is doing things the hard way though.

Here is how to break it down:

the iif is an "immediate if" statement. It determines if the first condition
is true or not. If it is true, then it returns the first result, if false it
returns the second.

iif(test, value if true, value if false)

The test in your case is whether baseline start is a very big number. If
there is no baseline, then project sets the internal value of that field to
something like 2^32 -1 and displays the value "NA". You can test this using
a more readable formula using the projdatevalue function.

iif([Baseline Finish]=projdatevalue("NA"), "Has Baseline", "No Baseline")

The value if this is true for your formula is to return the string "Not
Baselined".

The value if false (that is there is a baseline) is another iif statement.

Nesting iif statements makes complicated formulas possible. I do it all the
time.

Evaluate the nested iif in the same way. In this example it checks if the
baseline start for the field is less than the current date AND that there is
no actual start yet. If that is true then it returns "should have started".
If it is false then an empty string "" is returned.

There is probably an easier way to write this formula, but if you have them
and they are working you can stick with them.

If you want to read more on custom fields follow this link:

http://zo-d.com/blog/archives/programming/working-with-custom-field-formulas.html

-Jack Dahlgren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top