Char Limit to Formulas??

J

Jmorrison

Good Morning all... I am in need of some assistance with a switch function in
a custom text field (Project 2007). I am thinking that there is a limit to
the number of chars allowed in the formula but need another opinion.

Here is my formula:
Switch([Text2]="MVA_P1_PRJ_001","PMO",
[Text2]="MVA_P1_PRJ_002","Programme Security",
[Text2]="MVA_P1_PRJ_003","Facilities - Initial Location",
[Text2]="MVA_P1_PRJ_004","Facilities - Master Plan",
[Text2]="MVA_P1_PRJ_005","Phase 2 SOW",
[Text2]="MVA_P1_PRJ_006","Release 0.1",
[Text2]="MVA_P1_PRJ_007","Release 1.0",
[Text2]="MVA_P1_PRJ_008","Digitized Database & Hosting",
[Text2]="MVA_P1_PRJ_009","Business Support Systems",
[Text2]="MVA_P1_PRJ_010","RFID Blueprint",
[Text2]="MVA_P1_PRJ_011","Organizational Design",
[Text2]="MVA_P1_PRJ_012","Business SProcess Design",
[Text2]="MVA_P1_PRJ_013","Change Management",
[Text2]="MVA_P1_PRJ_014","Training",
[Text2]="MVA_P1_PRJ_015","Business Planning & Readiness",
[Text2]="MVA_P1_PRJ_016","Programme Communications",
[Text2]="MVA_P1_PRJ_017","Multi-Year Plan",

)

The off thing is if I remove the last 4 sections the formula works great,
add any more and it stops dead.

any ideas?
 
J

JulieS

Hello Jmorrison,

I can confirm in testing that if I leave off the tests after
"Training" all appears to work fine. I tried changing the
"Business Planning & Readiness" to omit the "&" thinking that may
be the source -- no change.

I also tried stripping the right 3 values into another field --
thinking it may be an issue of the number of characters -- it
still failed, so I don't believe it's an issue of character limit.

You do have one extra "," in your formula, but omitting that does
not fix it.

A quick search in both Access and Project for the Switch function
also turned up no information on the number of allowed tests.

So, short answer -- yes, I see it too. Why -- I don't know.

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional
information about Microsoft Project
 
J

Jmorrison

Hi JulieS,

I think I may have found a reason... I kept looking for info online and
found a reference to Nested IIF statements... it turns out that you can only
have 14 nested IIF statements so I am assuming that it may also be true for
the Switch statements... Also the Char limit is over 4000 so I doubt that is
the issue.
 
J

JulieS

Likely you're correct. It would be nice to have that limitation
noted in any reference to the function however.


Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional
information about Microsoft Project
 
J

Jack Dahlgren MVP

Yes, formulas in Project are limited to a certain number of characters.
But you could probably make this fit by slight modification. Instead of
testing for Text2, grab the last two characters of it

Switch(Right([Text2],2) = ...
or use a case statement (similar to Switch)

That will remove all the "MVA_P1_PRJ_0" from your code and give you more
than a hundred characters to work with.

-Jack Dahlgren
 
Top