SOLVED

MS Project Formula

Copper Contributor

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 it doesn't recognize the statuses. can anybody help me?

7 Replies

@Riele485 

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.

2022-02-03_10-53-36.png

John

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)))
I even tried:
IIf(Str([Status])="Delayed";"1";"2"), in text field
best response confirmed by Dale_HowardMVP (MVP)
Solution
Riele485,
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
Thanks, John!
Riele485,
You're welcome and thanks for the feedback. If I answered your questions, please consider marking my response as the answer.
John
Change “;” with “,”
1 best response

Accepted Solutions
best response confirmed by Dale_HowardMVP (MVP)
Solution
Riele485,
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

View solution in original post