Forum Discussion
Ms project
Hello
MS project iif & switch formulas are not working please assist. I have tried a few colleagues same issue. When using IIf funtion it always returns a syntax error. Projdatediff works alright.
Also tried switch same error. I use a basic function to test like IIf(1=1,1,3).
Separator is correct and ms project version is Microsoft® Project® Online Desktop Client MSO (Version 2609 Build 16.0.20430.20032) 64-bit. Please assist
3 Replies
Microsoft Project does support IIf and Switch formulas in custom fields, but syntax errors usually occur if the formula is placed in the wrong field type or if quotation marks and separators are mismatched. The key is to ensure you are using these functions in a custom field formula (via Project > Custom Fields > Formula) and that the field type matches the return value (Text, Number, Flag, etc.).
https://support.microsoft.com/en-au/project/project-functions-for-custom-fields-in-project-desktop
- Possoto_Malome1Copper Contributor
It highlights ProjDateDiff, which is correct
- Possoto_Malome1Copper Contributor
Thank you for the response, however I am using the custom fields box using the formula below, but I keep getting errors. Please try on your side and provide an update.
IIf(ProjDateDiff(Start,[Status Date])/480>=Val(ProjDurConv([Baseline Duration],pjDays)),Val(ProjDurConv([Baseline Duration],pjDays)),IIf(DateDiff("d",[Baseline Start],[Status Date])<=0,1/100,ProjDateDiff(Start,[Status Date])/480))