SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a list on our new company sharepoint to track monthly sales orders, a kind of very basic sales pipeline if you will.

In our list we have "Sales Price" and "Cost Price" columns and from that, i am using two calculated columns to show "Profit" and "Margin" (as a %).

What i am looking to do, is colour code the "Margin" column as per the example below.


The code i am using to calculate the margin column is:

=Profit/[Sales Price]

Thanks in advance :D

share|improve this question

You can extend the use of those calculated columns to provide the color coding you need. With the help of CEWP, you can use the calculated formula to provide additional formatting and the formula will determine which color the value will be.

You need the a script to load on a CEWP and make changes to the calculated column.

Check out this link to follow the steps to it:

share|improve this answer
Hi Mike, Thanks for that, i had read that earlier, but struggled to make that work with my existing calculation code. Would you be able to advise on the best way to formulate this as when i tried i kept getting syntax errors :( – Carl S Aug 20 '12 at 17:40

Please have a look at following article

There are a variety of ways to add color coding to your SharePoint lists and document libraries, from embedding custom code on your page to creating data view web parts with conditional formatting in SharePoint Designer. The trick is determining which method works best in your situation.

Solution works for 2007 & 2010 versions.

share|improve this answer

I've written an article on the various ways of achieving this on our company blog. These are (in summary):

Client based

  • JavaScript: Put some JavaScript code into a Content Editor Web Part
  • Designer: Use SharePoint Designer to set up Conditional Formatting

Custom Field Type

  • Code it yourself: Make your own custom field type from scratch
  • Buy: Purchase a pre-made solution (naturally, I recommend our own product 'SharePoint Highlighter')

More information, links, and persuasive sales talk can be found in the article: How to do list highlighting in SharePoint

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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