Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
I would write it like this:
Writing this formula in this fashion will allow you to scan and update the breakpoints easily as everything is in a natural order and "pointing" in the same direction.
But (1) you did not state what you expect and (2) you said [Weeks] was a Numeric field so I don't know why you were converting it to a number with ToNumber().
Also, I would consider what you want when $NumWeeks was 68 or greater as your draft formula is going to default to "Phase 6" and I am not sure that is what you want..
var Number NumWeeks = ToNumber([Weeks]);
If([Project Type] = "New",
If(
55 <= $NumWeeks and $NumWeeks < 68, "Phase 1",
41 <= $NumWeeks and $NumWeeks < 54, "Phase 2",
27 <= $NumWeeks and $NumWeeks < 40, "Phase 3",
13 <= $NumWeeks and $NumWeeks < 26, "Phase 4",
1 <= $NumWeeks and $NumWeeks < 12, "Phase 5",
"Phase 6"
)
)
Writing this formula in this fashion will allow you to scan and update the breakpoints easily as everything is in a natural order and "pointing" in the same direction.
But (1) you did not state what you expect and (2) you said [Weeks] was a Numeric field so I don't know why you were converting it to a number with ToNumber().
Also, I would consider what you want when $NumWeeks was 68 or greater as your draft formula is going to default to "Phase 6" and I am not sure that is what you want..