Help me with a formula

M

max

Dears,
In MS project i was trying to use the following formula for indicators,
which i experimented but needs some fine tuning.Can someone please help

Switch((([% Complete]=100) And ([Finish Variance]=0)),"Complete",(([Finish
Variance]>=0) And ([% Complete]<100)),"On Track",(([Finish Variance]>=1) And
([% Complete]<100)),"Late",(([Finish Variance]>=2) And ([%
Complete]<100)),"Delayed")

Also as seen in thsi formula i dont wnt it this way. I shld compare not with
[fiinsh variance] but with [Finish] field . I want to compare [Finish] field
with current date and if it skips days need the above conditions
Thanks
max
 
M

max

Infact i tried this

Switch(([% Complete]=100),"Complete",(([Current Date]<[Finish]) And ([%
Complete]<100)),"On Track",(([Current Date]>[Finish]) And ([%
Complete]<100)),"Late")
it is working fine

now i have to add one more condition that if the current date is greater
than 10 days of finish i want to show that as delyaed delayed,but the code is
not working fine.

...."Late",(([Current Date]>([Finish]+10)) And ([% Complete]<100)),"Delayed")

if it is wrong pls let me know
 
B

Bryan Phelps

hi Max,

Are you using this formula in Project Pro/Standard or on Project Server?

I tested this formula in Project Pro:

Switch(([% Complete]=100),"Complete",([Current Date]<[Finish]),"On
Track",([Current Date]>([Finish]+10)),"Delayed",([Current
Date]>[Finish]),"Late")

and it seems to work correctly. I think the problem is, it looks like you
added the "Delayed" condition after the "Late" condition. With the Switch
statement, the tests get evaluated in order - so it tries each one, and as
soon as one succeeds, it outputs that value. In this case, if [Current
Date]>[Finish]+10 is true, then [Current Date]>[Finish] is also true, and it
saw the latter case first, and outputted "Late" as a result. I hope that
makes sense! Please let me know if you have any questions.

Cheers,
Bryan

max said:
Infact i tried this

Switch(([% Complete]=100),"Complete",(([Current Date]<[Finish]) And ([%
Complete]<100)),"On Track",(([Current Date]>[Finish]) And ([%
Complete]<100)),"Late")
it is working fine

now i have to add one more condition that if the current date is greater
than 10 days of finish i want to show that as delyaed delayed,but the code is
not working fine.

..."Late",(([Current Date]>([Finish]+10)) And ([% Complete]<100)),"Delayed")

if it is wrong pls let me know

max said:
Dears,
In MS project i was trying to use the following formula for indicators,
which i experimented but needs some fine tuning.Can someone please help

Switch((([% Complete]=100) And ([Finish Variance]=0)),"Complete",(([Finish
Variance]>=0) And ([% Complete]<100)),"On Track",(([Finish Variance]>=1) And
([% Complete]<100)),"Late",(([Finish Variance]>=2) And ([%
Complete]<100)),"Delayed")

Also as seen in thsi formula i dont wnt it this way. I shld compare not with
[fiinsh variance] but with [Finish] field . I want to compare [Finish] field
with current date and if it skips days need the above conditions
Thanks
max
 
M

max

Hi Bryan,
Thanks a ton for your suggestions. Well atleast you did not tell me my
formula was wrong, as i from nowhere I came out with this formula.
I do understand now about Switch, i too used it and it seems to work fine.
Regarding fields; I tried it out locally on a file in Project Pofessional.

Now i am planning to create an Enterprise custom field in PWA and then make
it calculate in project professional.
Thanks a lot again
Max

Bryan Phelps said:
hi Max,

Are you using this formula in Project Pro/Standard or on Project Server?

I tested this formula in Project Pro:

Switch(([% Complete]=100),"Complete",([Current Date]<[Finish]),"On
Track",([Current Date]>([Finish]+10)),"Delayed",([Current
Date]>[Finish]),"Late")

and it seems to work correctly. I think the problem is, it looks like you
added the "Delayed" condition after the "Late" condition. With the Switch
statement, the tests get evaluated in order - so it tries each one, and as
soon as one succeeds, it outputs that value. In this case, if [Current
Date]>[Finish]+10 is true, then [Current Date]>[Finish] is also true, and it
saw the latter case first, and outputted "Late" as a result. I hope that
makes sense! Please let me know if you have any questions.

Cheers,
Bryan

max said:
Infact i tried this

Switch(([% Complete]=100),"Complete",(([Current Date]<[Finish]) And ([%
Complete]<100)),"On Track",(([Current Date]>[Finish]) And ([%
Complete]<100)),"Late")
it is working fine

now i have to add one more condition that if the current date is greater
than 10 days of finish i want to show that as delyaed delayed,but the code is
not working fine.

..."Late",(([Current Date]>([Finish]+10)) And ([% Complete]<100)),"Delayed")

if it is wrong pls let me know

max said:
Dears,
In MS project i was trying to use the following formula for indicators,
which i experimented but needs some fine tuning.Can someone please help

Switch((([% Complete]=100) And ([Finish Variance]=0)),"Complete",(([Finish
Variance]>=0) And ([% Complete]<100)),"On Track",(([Finish Variance]>=1) And
([% Complete]<100)),"Late",(([Finish Variance]>=2) And ([%
Complete]<100)),"Delayed")

Also as seen in thsi formula i dont wnt it this way. I shld compare not with
[fiinsh variance] but with [Finish] field . I want to compare [Finish] field
with current date and if it skips days need the above conditions
Thanks
max
 

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