# Formula for 15% Deviation

• ### Question

• Hi

I could use some help creating a formula with 3 conditions:

1. If   Finish <=  baseline Finish10 --> Indicator:  Green flag (if on a Number field can return 3)

2. If   Finish > baseline Finish10, with a deviation of below 15% in days --> Indicator: Red Flag (return 2)

3. If   Finish > baseline Finish10, with a deviation of above 15% in days --> Indicator: Black flag (return 1)

I know the logic but having a hard time converting the dates to days for the comparison of:

Finish - Baseline finish <= 0.15 * {Duration Difference/Deviation}

Should i use ProjDateDiff , ProjDurValue, or other functions?  and how?

Can anyone assist?

Thanks!

Ofir Marco , MCTS P.Z. Projects

Monday, October 29, 2012 6:07 AM

### Answers

• Never mind...

I did it using 2 fields:

-  First field (called duration 9)

Type:   Duration

formula:    [Finish] - [Baseline10 Finish]

- Seconf field:

Type: Number

formula:

IIf ([Finish] <= [Baseline10 Finish],2 , IIf ( [Duration9] <= (0.15*[Duration]) ,1 ,

IIf( [Duration9] >(0.15*[Duration]),0,-1)))

Ofir Marco , MCTS P.Z. Projects

Monday, October 29, 2012 6:43 AM

### All replies

• Never mind...

I did it using 2 fields:

-  First field (called duration 9)

Type:   Duration

formula:    [Finish] - [Baseline10 Finish]

- Seconf field:

Type: Number

formula:

IIf ([Finish] <= [Baseline10 Finish],2 , IIf ( [Duration9] <= (0.15*[Duration]) ,1 ,

IIf( [Duration9] >(0.15*[Duration]),0,-1)))

Ofir Marco , MCTS P.Z. Projects

Monday, October 29, 2012 6:43 AM
• Ofir,

You can do it in only one step. The more formulas you add, the slower Project will calculate.

Try this. Should have the same result:

`Switch([Finish]<=[Baseline10 Finish],2,(ProjDateDiff([Baseline10 Finish],[Finish],[Project calendar])<=([Duration]*0.15),1,(ProjDateDiff([Baseline10 Finish],[Finish],[Project calendar])>([Duration]*0.15],0,True,-1)`

Best regards,

Rene Alvarez

Tuesday, October 30, 2012 3:17 PM
• Thanks.

I'll try it.

Can you tell me what is Switch function?

Ofir Marco , MCTS P.Z. Projects

Tuesday, October 30, 2012 3:23 PM