color formatting of numbers (can't use SPD) RRS feed

  • Question

  • is there a way to change a number color if its a negative number? I have a calculated field and its a negative number I want it red. Is there a way to accomplish this in the calc field formula section?

    Wednesday, April 2, 2014 2:58 PM

All replies

  • If I'm creating a calc column....

    =IF([Number Field]<0,CONCATENATE("<font color=red>",[Number Field],"</font>"),[Number Field])

    Format that as a number. If the number field you're pulling from isn't formatted as a number, then use the ISNUMBER(FIND("-",[Number Field])). That will tell you if the number has a negative in it. Or alternatively, LEFT([Number Field],1) for the first character only.

    Andy Wessendorf SharePoint Developer II | Rackspace andy.wessendorf@rackspace.com

    • Proposed as answer by SekThang Thursday, April 3, 2014 10:13 AM
    Wednesday, April 2, 2014 6:40 PM
  • when i add this to the calc column, the HTML is showing up on my list and not the formated column in red if >0
    Thursday, April 3, 2014 2:14 PM