Forum Discussion
Riele485
Feb 03, 2022Copper Contributor
MS Project Formula
Guys, I'm trying to apply a simple formula in the project, but I'm not having success: IIf([Status]="Late";"1";IIf([Status]="Completed";"2";IIf([Status]="Due";"3";"4"))) It always accuses 4, as if ...
- Feb 03, 2022Riele485,
You missed the point of my answer, the custom field where you have you formula is not the problem, the problem is the test in your formula. This formula in a custom Number or Text field will work:
IIf([Status]=2;1;IIf([status]=0;2;IIf([Status]=3;4)))
By the way, there is no "Due" entry in the Status field, unless you created your own custom field called "Status". I assume by "Due" you mean "Future task".
John
John-project
Silver Contributor
It fails because the Status field is not a text string, regardless of how it is displayed. Use these numerical values and your formula will work as desired.
John
Riele485
Feb 03, 2022Copper Contributor
Thank you, John, for your contribution! But, I had already tried customizing numeric field, because I saw that the Status is as numeric. It still didn't work!
IIf([Status]="Late";1;IIf([Status]="Completed";2;IIf([Status]="Due";3;4)))
IIf([Status]="Late";1;IIf([Status]="Completed";2;IIf([Status]="Due";3;4)))
- Riele485Feb 03, 2022Copper ContributorI even tried:
IIf(Str([Status])="Delayed";"1";"2"), in text field - John-projectFeb 03, 2022Silver ContributorRiele485,
You missed the point of my answer, the custom field where you have you formula is not the problem, the problem is the test in your formula. This formula in a custom Number or Text field will work:
IIf([Status]=2;1;IIf([status]=0;2;IIf([Status]=3;4)))
By the way, there is no "Due" entry in the Status field, unless you created your own custom field called "Status". I assume by "Due" you mean "Future task".
John- Riele485Feb 03, 2022Copper ContributorThanks, John!
- John-projectFeb 03, 2022Silver ContributorRiele485,
You're welcome and thanks for the feedback. If I answered your questions, please consider marking my response as the answer.
John
- HsalaheldeenFeb 09, 2022Copper ContributorChange “;” with “,”