0

I'm working on trying to figure out what I'm doing wrong with my calculation script, the server gives me an error (nothing that says what the problem is ofcourse), just that nice "Sorry, something went wrong" and Go Back to the Site". Can anyone see what I need to fix in my script? I used Notepad++ to check my brackets and ()'s and they all seem ok. The script runs fine until inserting the nested IFs (the IFs script works fine in another calculation). But, as I have multiple funding sources, I need to include the IFs!

Script:

 ="CFDA "&([PAZ_CFDA]&" "&**IF([FAA %]>0,"FAA "&[PAZ_FedSource_FAA]&"%",IF([FRA %]>0,"FRA "&[PAZ_FedSource_FRA]&"%",IF([FTA %]>0,"FTA "&[PAZ_FedSource_FTA]&"%",IF([FHWA %]>0,"FHWA "&[PAZ_FedSource_FHWA]&"%","OTHER "))))**"&Task Assignment: "&[PAZ_TA#]&" "&[Title]&" Date Awarded "&TEXT([DateNoticeOfAward],"MM/DD/YY")&" Not to Exceed Budget = "&TEXT([$ Technical Budget Award],"$#,###.00;($#,###.00)")&" Expended thru 06/30/2015 = "&TEXT([$ ExpendedToDate],"$#,###.00;($#,###.00)"))
4
  • Ugh, usually when I ask for help, I fix the problem. Sigh...
    – DMayfield
    Commented Jul 10, 2015 at 19:28
  • Is the quote after the IF misplaced ?
    – JayHell
    Commented Jul 10, 2015 at 19:30
  • Sadly though the result doesn't display multiple funding sources as I'd expected. When applicable I had expected a result like this; ...Grants FTA 80% FRA 50% Task Assignment... What I get instead is the first source; ...Grants FTA 80% Task Assignment... Well, back to the drawing board LOL...
    – DMayfield
    Commented Jul 10, 2015 at 19:51
  • @JayHell, yeppers!
    – DMayfield
    Commented Jul 10, 2015 at 19:55

1 Answer 1

0

In NotePad you can format your Formula with line-breaks and indenting tabs or spaces. SharePoint will ignore all on saving your formula.

In any decent texteditor you can save your formula with .ml extensions to get (some) syntax highlighting.

="CFDA "
&[PAZ_CFDA]
&" "
&
IF([FAA %]>0
,"FAA "&[PAZ_FedSource_FAA]&"%"
,IF([FRA %]>0
    ,"FRA "&[PAZ_FedSource_FRA]&"%"
    ,IF([FTA %]>0
        ,"FTA "&[PAZ_FedSource_FTA]&"%"
        ,IF([FHWA %]>0
            ,"FHWA "&[PAZ_FedSource_FHWA]&"%","OTHER ")
        )
    )
)
&"Task Assignment: "
&[PAZ_TA#]
&" "
&[Title]&" Date Awarded "
&TEXT([DateNoticeOfAward],"MM/DD/YY")
&" Not to Exceed Budget = "
&TEXT([$ Technical Budget Award],"$#,###.00;($#,###.00)")
&" Expended thru 06/30/2015 = "
&TEXT([$ ExpendedToDate],"$#,###.00;($#,###.00)")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.