Forum Discussion

Riele485's avatar
Riele485
Copper Contributor
Feb 03, 2022

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

  • 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
  • John-project's avatar
    John-project
    Silver Contributor

    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.

    John

    • Riele485's avatar
      Riele485
      Copper 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)))
      • Riele485's avatar
        Riele485
        Copper Contributor
        I even tried:
        IIf(Str([Status])="Delayed";"1";"2"), in text field

Resources