IIF
(immediate if) statements are one of the most commonly used functions in ms project formulas. An IIF statement is basically a condensed version of the "If ...Then .. Else"
statement which is often used in programming. The iif statement takes three arguments:
IIf( expression, truepart, falsepart )
The first is the expression
you want to evaluate. It needs to be constructed so that it has a true or false answer so it is commonly used to compare vs. a particular value. (see this article for comparing with "NA" ). What the iif statement does next is dependent on whether the result is true or false.
If the expression is true then the truepart
is returned. This sounds quite simple and can be very simple. You could return something like a text value or a number. However, the power of the iif statement is that the truepart
can be another expression, even another iif statement
. This allows you to construct and test many parameters in a single formula.
If the expression is false then the falsepart
is returned. Like the truepart
it can be an expression or set of nested expressions.
The difficult part of constructing a good nested iif statement is to put the tests in the correct order. Once the statement follows a path to the end, any other ends are not evaluated. The second limitation is that custom field formulas are limited to 256 characters so be economical with your text.
The IIF
statement is also available in Excel for cell formulas, but in more recent versions of Excel (XP, 2003, perhaps 2000) it is called the If
statement with exactly the same syntax.
Comments (1)
How do you force the project to have a changeable start date, but keep the duration for the tasks the same? I'm working with a DR project that has a fixed duration of 48 hours for certain tasks to be completed -- this is the maximum allowed time for the tasks no matter when the project actually starts (i.e. the start of the project may be any time, but when a disaster is invoked, the clock starts running at that time for the 48 hour duration for the tasks)
Posted by Jerry | September 7, 2006 11:45 AM
Posted on September 7, 2006 11:45