13 Mar
Posted by Chandoo as Analytics, excel, hacks, ideas, technology, visualization
Excel conditional formatting is a hidden and powerful gem that when used well, can change the outlook of your project report / sales budget / project plan or analytical outputs from bunch of raw data in default fonts to something truly professional and good looking. Better still, you dont even need to be a guru or excel pro to achieve dramatic results. All you need is some coffee and this post to learn some cool conditional formatting tricks.
So you got your coffee mug? well, lets start!
The 5 tricks we are going to learn are,
I have created an excel sheet containing all these examples. Feel free to download the excel and be a conditional formatting rock star
1. Highlighting alternative rows / columns in tables:

Often when you present data in a large table it looks monotonous and is difficult to read. This is because your eyes start interpreting the data as grid instead of some important numbers. To break this you try highlighting or changing the background color of alternative rows / columns. But how would you do this if you have rather large table and it keeps changing. The trick lies in Conditional Formatting. (Of course you can use the built-in auto format feature, but we all know how the default settings of various Microsoft products are like).
=MOD(ROW(),2)=0
which means, whenever row() of the current cell is even, to change the coloring to odd rows, you just need to put =MOD(ROW(),2)=1 as formula
Also, if you want to highlight alternative columns instead of rows you can use the column() formula.
What if you want to change background color of every 3rd row instead, just use =MOD(ROW(),3)=0 instead. Just use your imagination.
2. Creating a quick project plan / gantt chart using conditional formatting:

Project plans / gantt charts are everyday activity in most of our lives. Creating a simple and snazzy project plan template in excel is not a difficult job, using conditional formatting a bit of formulas you can do it no time.
=IF(AND(F$8>=$D9, F$8<=$E9),"1","")
Which means, whenever, the day number represented on the top row is between start and end we will in 1 in the corresponding cell.
3. Extreme In-cell Graphs:
Incell graphing is a nifty trick that basically uses REPT() function (used to repeat a string, character given number of times) to generate bar-charts with in a cell. You can apply conditional formatting on top of them to give the charts a good effect. Here is a sample:

The above is a table of visits to Pointy Haried Dilbert
in the month of January 2008. As you can see I have highlighted (by changing the font color to red and making it bold) for the cells that have more than average number of visits in the month. I am not going to tell you how to do it, it is your home work
4. Highlight mistakes / errors / omissions / repetitions using conditional formatting:

Often we will do highly monotonous job like typing data in a sheet. Since the work is monotonous you tend to make mistakes, omit a few or repeat something etc. This can be avoided by conditional formatting. I use this trick whenever I am typing something or pasting a formula over a rather large range of cells (for eg. vlookup on annual revenue data of all your accounts, could run in to thousands of rows across multiple states /regions etc.).
Lets see how you can highlight a cell when it has an error:
=iserror() (see below)
countif() would do the magic for you, or Omissions (again a countif()) 5. Creating dash boards using excel conditional formatting:
As I said before you can use conditional formatting to create intuitive sales reports or analytics outputs. Like the one shown here,

Here is how you can do it:
=ROUND(C10,0) & " " & IF(C9
Essentially, what we are doing is, whenever the cell value is more than its predecessor in the data table we are appending the symbol â–² (go to menu > insert > symbols and look for the above one) etc.
I have created an excel sheet containing all these examples. Feel free to download the excel and be a conditional formatting rock star.
Also read : Create dash boards in Excel | How to draw impressive charts in Excel | Changing the default chart settings to impress everyone
Share some love, add this to Stumble
Get my Feed, its yummy
61 Responses
Create an Excel Gantt Chart with Conditional Formatting [Excel Tip] · TechBlogger
March 14th, 2008 at 1:21 am
1[...] Gantt chart template here. Here’s more on using conditional formatting in your spreadsheets. Learn Cool Microsoft Excel Conditional Formatting Tricks [...]
Metaholic » 5 Cool Excel Conditional Formatting Tricks
March 14th, 2008 at 2:20 am
2[...] [view original post] [source: Delicious] Previously - Google Sky Next - [...]
Metaholic » 5 Cool Excel Conditional Formatting Tricks
March 14th, 2008 at 2:20 am
3[...] [view original post] [source: Delicious] Previously - Google Sky Next - [...]
Create an Excel Gantt Chart with Conditional Formatting [Excel Tip] » Lifehacker, tips and downloads for getting things done
March 14th, 2008 at 2:39 am
4[...] Gantt chart template here. Here’s more on using conditional formatting in your spreadsheets. Learn Cool Microsoft Excel Conditional Formatting Tricks [...]
talljoanne
March 14th, 2008 at 3:04 am
5Hi Chandoo, got here via Lifehacker and just wanted to say what a lifesaver this is! I don’t know who in the world picked the default colors for Excel charts, but they are truly hideous. (You’d think Microsoft can afford to hire someone with better sense aesthetics.) Thanks for bringing in some beauty into the corporate world indeed.
purrl.net |** urls that purr **|
March 14th, 2008 at 3:06 am
6This is one of the web’s most interesting stories on Fri 14th Mar 2008
These are the web’s most talked about URLs on Fri 14th Mar 2008. The current winner is ..
magic tricks » Blog Archive » Want to be an Excel Conditional Formatting Rock Star ? Read this
March 14th, 2008 at 3:22 am
7[...] Read the rest of this great post here [...]
more formulas
March 14th, 2008 at 5:02 am
8[...] information would be helpful. So what follows is for them or you, if you flivewithdesire.typepad.comWant to be an Excel Conditional Formatting Rock Star ? Read this Excel conditional formatting is a hidden and powerful gem that when used well, can change the [...]
5 Cool Excel Conditional Formatting Tricks
March 14th, 2008 at 5:04 am
9[...] the rest of the post here Share and Enjoy: These icons link to social bookmarking sites where readers can share and [...]
Krishna
March 14th, 2008 at 7:13 am
10Hi chandoo…nice tips and i would use it in my work. So where are you now? based out chennai or moved to
US for a long term. I think you are now still with TCS. rite?
links for 2008-03-14 « Stand on the shoulders of giants
March 14th, 2008 at 7:20 am
11[...] Learn Cool Microsoft Excel Conditional Formatting Tricks - Be a Rock star (Tips | How tos - Save tim… (tags: awesome cool guide how-to office technique tips formatting Excel) No Comments so far Leave a comment RSS feed for comments on this post. TrackBack URI Leave a comment Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> [...]
Web 2.0 Announcer
March 14th, 2008 at 10:22 am
12Learn Cool Microsoft Excel Conditional Formatting Tricks - Be a Rock star (Tips | How tos - Save time, impress everyone) | Pointy Haired Dilbert - Chandoo.org
[...][...]
Berry Zito
March 14th, 2008 at 2:18 pm
13Thanks Chandoo!! I’ve never seen these features and will use them daily :O)
RKB
March 14th, 2008 at 2:20 pm
14In the Gantt chart example, instead of matching the font with the cell color, you can also simply apply a custom formatting of “;;;” which hides any text in the cell. That way you can feel free to mix and match colors (or even apply some conditional formatting on colors of the Gantt chart) without worrying about changing the font, too.
Wayne Elgin
March 14th, 2008 at 4:14 pm
15For the Gantt Chart:
You could ignore the contents of the cell altogether if you put =AND(F$8>=$D9, F$8<=$E9) directly into the conditional formatting “Formula Is” section and filled that out into the rest of the cells.
Neater, no?
roScripts - Webmaster resources and websites
March 14th, 2008 at 4:15 pm
165 Cool Excel Conditional Formatting Tricks
Excel conditional formatting is a hidden and powerful gem that when used well can change the outlook of your project report sales budget project plan or
PHD gets lifehacked deliciously !!! | Pointy Haired Dilbert - Chandoo.org
March 14th, 2008 at 6:06 pm
17[...] I am overwhelmed by the response the Excel Conditional Formatting Rockstar post generated. I got both lifehacked and del.icio.us home paged on the sameday and Wow, I am so happy [...]
Daily Links | Akkam's Razor
March 14th, 2008 at 6:19 pm
18[...] Learn Cool Microsoft Excel Conditional Formatting Tricks - Be a Rock star (Tips | How tos - Save tim… (tags: excel howto formatting tips productivity software conditional) [...]
links for 2008-03-14 « the art of foo
March 14th, 2008 at 9:22 pm
19[...] Learn Cool Microsoft Excel Conditional Formatting Tricks - Be a Rock star (Tips | How tos - Save tim… How MS Excell can be fun (tags: excel howto formatting productivity tips conditional) [...]
Chris Carlson » links for 2008-03-14
March 14th, 2008 at 11:47 pm
20[...] Microsoft Excel Conditional Formatting Tricks (tags: microsoft excel conditional formatting software office) [...]
Skylog » Blog Archive » links for 2008-03-15
March 15th, 2008 at 6:17 am
21[...] Learn Cool Microsoft Excel Conditional Formatting Tricks (tags: software) [...]
Create an Excel Gantt Chart with Conditional Formatting [Excel Tip]
March 15th, 2008 at 8:02 am
22[...] Gantt chart template here. Here’s more on using conditional formatting in your spreadsheets. Learn Cool Microsoft Excel Conditional Formatting Tricks [...]
links for 2008-03-16 « Mehul’s wordpress blog
March 16th, 2008 at 7:27 am
23[...] Learn Cool Microsoft Excel Conditional Formatting Tricks - Be a Rock star (Tips | How tos - Save tim… (tags: excel howto business) [...]
links for 2008-03-15 « linksnstuff
March 16th, 2008 at 7:41 am
24[...] Learn Cool Microsoft Excel Conditional Formatting Tricks - Be a Rock star (Tips | How tos - Save tim… (tags: excel software) [...]
20080317 網摘 - 2038 年蟲 - 網絡暴民 Jacky’s Blog
March 17th, 2008 at 1:29 am
25[...] Learn Cool Microsoft Excel Conditional Formatting Tricks 如 alternate row color, gantt chart [...]
20080317 網摘 - 2038 年蟲 - 網絡暴民 Jacky’s Blog
March 17th, 2008 at 1:29 am
26[...] Learn Cool Microsoft Excel Conditional Formatting Tricks 如 alternate row color, gantt chart [...]
magenie
March 18th, 2008 at 3:26 am
27Okay I need help here, O Excel Master.
Let’s say I have a task that needs to be done by a colleague in 3 hours. How do I make a cell change colour when that specific time is reached? I tried many ways using conditional formatting but the cell just won’t change colour when the time comes!
Chandoo
March 18th, 2008 at 10:35 am
28Wow, I am overwhelmed by the comments and pingbacks, thanks everyone.
@talljoanne: thanks, welcome to PHD


@Krishna: welcome back, I with tcs, moved to us though
@Berry Zito: thanks, welcome to PHD
@RKB: that is a cool trick, I shall use it going forward, thanks for sharing your tips with PHD readers.
@Wayne Elgin: Pretty neat trick indeed, reduces the need to paste the formula over a large range, thanks for sharing it, welcome to PHD
Chandoo
March 18th, 2008 at 10:42 am
29@magenie: Thanks for dropping by. Hmm, that could be little tricky, but I am sure we can do this. I remember doing this for dates onces (when a deadline reaches that column would highlight), lets see how we can do this :
1. let me assume that we have task desc in cell a1
2. task target time (3:30 PM for eg.) in cell a2
3. We aim to change the color of cell a1 and a2 to red (or whatever) when the time is 3:30
4. The conditional formula could be something like :
=$a$2=now()
5. Now() would tell me what the date and time now is. It may not work correctly since now() would return date also, you can avoid this by converting date-time to only time using hour(), minutes() functions I guess.
6. Once you are done you can press “f9″ every now and then. This will force excel to recalculate formulas or if you close your workbook and reopen excel would do the same ideally (unless you explicitly changed the options)
let me know if this helps you, welcome to PHD
magenie
March 18th, 2008 at 1:35 pm
30Thanks for the speedy response, Chandoo!
I’ve actually tried that method earlier, but couldn’t set the NOW() function in the conditional formatting field to only calculate the time. This are some of the other things I attempted (without success):
1) Fill in two cells, one (A1) with NOW(), formatted to display current time only, and another cell (A2) with target time. Then set conditional formatting so that A1 changes color when cell value =A2.
2) Fill a cell (B1) with target time including date so that I could use set conditional formatting for B1 to change color when cell value equals to =NOW()=B1.
I can’t remember what other methods I’ve tried despite knowing it wasn’t gonna work. Sigh..
I’ve used Excel 2003 and 2007 as well. Both failed me. Or maybe I failed them..
Yelp…
Chandoo
March 18th, 2008 at 2:47 pm
31@magenie : hmm
first let me respond to your comment -
1) fill in two cells, one (A1)….
the value a cell displays is different from the underlying value of the cell, display value is based on the format you select, but when you access the cell through formulas, excel will pick up the background value which could be diff from display value, may be this is why you are having trouble doing the conditional check.
also, excel now() function returns time in seconds (and probably in milli seconds as well, not sure) so your conditional formatting may turn off even before you notice it.
Now, let me give you another solution…
in A1- enter time in “10:00 AM” format, just type in the value, excel will know that you have entered time and format the cell accordingly.
in A2 - enter the following formula “=TIME(HOUR(NOW()),MINUTE(NOW()),0)”, essentially I am extracting current hour and minute and manually setting seconds to zero to create a time.
now change color of A1/A2 when A1=A2 (make sure you put the correct cell address i.e. $a$1=$a$2 if needed)
I have tried this in a sheet and it seems to be working fine. Let me know if this works for you. I can send you the excel if you want.
Formatação Condicional no Excel. - 2.0 WEBMANIA - NotÃcias, Reviews, Previews, Mashups, Recursos e Dicas na Web 2.0
March 18th, 2008 at 8:41 pm
32[...] formatação condicional no Excel (ou qualquer outra folha de cálculo). O artigo em causa, “Want to be an Excel Conditional Formatting Rock Star? Read This“, enumera e explica 5 técnicas que poderá utilizar na formação das suas tabelas mais [...]
magenie
March 19th, 2008 at 1:03 am
33It works, it works!
At first it didn’t coz I used “Cell value”.. I’m always unsure when to use cell value and when to use formula, since I entered the target time (a value) into the first cell, and not a formula.
But no matter, as long as it works. You ze best, Chandoo.
TCL
March 19th, 2008 at 6:55 am
34Great ideas and many thanks.
Can u please give examples for conditional formatting in open office Calc instead of using Excel?
Chandoo
March 19th, 2008 at 3:24 pm
35@magenie .. I am happy it is working for you
@TCL : welcome to PHD, thanks for your comments.
Hmm, Open office calc is not yet installed on my laptop, may be this weekend I will spend sometime with it and start writing about it as well.
Mike
March 22nd, 2008 at 9:27 am
36How do you insert the up and down arrows in the formulas on the dashboard (item 5)?
Chandoo
March 22nd, 2008 at 7:57 pm
37@Mike .. thanks for visiting PHD, welcome…
you can insert up /down arrows from menu > insert > symbols (then you have to look up the symbol you want), the list will have all the symbols your current font has (you can even change font form that dialog)
Let me know if this is not working for you..
Cheryl
March 29th, 2008 at 3:43 pm
38This is great stuff! I was trying to find out how to fix a problem I was having with a conditional formatting. I have a worksheet where I enter 1 or 0. For 1, I want to highlight the cell green (that part works fine) for 0, I highlight red. The problem is that Excel thinks all blank cells are 0’s and turns the whole thing red! Do you have any suggestions?
Also, do you use pivot tables at all? Thanks!
Chandoo
March 31st, 2008 at 8:23 pm
39@Cheryl - Thanks for visiting PHD and commenting
coming to your question : “…The problem is that Excel thinks all blank cells are 0’s and turns the whole thing red!…”
you can try the conditional formatting with functions (instead of cell values) and give a formula that goes like,
=and(isnumber(cell),cell=0)
that is if you must use conditional formatting on ZERO, easier option is to replace zeros with some other value and excel would not mistake them for empty cells. Another option would be to replace empty cells in your table with some default value (like a hyphen - or something)
Yeah, I do use pivot tables, may be sometime I will write about those here
Cheryl
April 1st, 2008 at 10:26 pm
40Thanks Chandoo. Of course it would have been easier to change the zero to a different value… but my boss was insistent on 1’s and zero’s.
I look forward to reading about pivot tables.. I use them all the time. I tried to get your charts to work in a pivot chart but didn’t get it to work. : (
How to get more than 56 colors in excel chart - simple trick | Pointy Haired Dilbert - Chandoo.org
April 9th, 2008 at 8:35 pm
41[...] Also: Download 73 beautiful excel chart templates | Art of excel charting | Become a conditional formatting pro [...]
???????WP » ????????????
May 14th, 2008 at 8:42 am
42[...] Learn Cool Microsoft Excel Conditional Formatting Tricks [...]
manish
May 20th, 2008 at 10:13 am
43hi
how do you convert numbers to figures eg 1207 to one thousand two hundred & seven
Chandoo
May 20th, 2008 at 2:36 pm
44@ Manish .. thanks for the comments, welcome to PHD…
try this UDF http://www.ozgrid.com/VBA/ValueToWords.htm to convert a value to words, not sure if that works for all the values… let me know if this helps
Gantt in 60 seconds - churn out an excel project plan in no time | Pointy Haired Dilbert - Chandoo.org
May 20th, 2008 at 9:47 pm
45[...] read: Learn how to create project plans / gantt charts using conditional formatting Create art grade excel charts with these 73 designer templates Other uber cool excel tricks to make [...]
Gaetan
May 23rd, 2008 at 2:20 pm
46Chandoo, I love this page!
I have a question, I don’t think it’s achievable though.
Let’s say I have a ‘pass value’ of 10. Anything above 10 will be green (it’s above the pass value) and anything below 10 will be red.
This is easy to do with conditional formatting as per your example.
What I’d like to do is that in a cell where the value is 12 (hence green), and where its predecessor was higher, then I’d like to have the down arrow next to the green 12 to be red.
So the 12 will be green Still above the ‘pass value’ but the arrow will be red (since the value is lower than its predecessor).
Let me know what you think, I looked around but could not get that to work.
Thanks again
What the IF? - learn 6 cool things you can do with excel if() functions | Pointy Haired Dilbert - Chandoo.org
June 9th, 2008 at 8:18 pm
47[...] All you need to do is add an additional column at the end of the table and fill it with 1s and 0s. (just enter 1 and 0 in 2 rows, select both of them and drag till the end of the table). Now we can use this column to test our condition by writing the sumif function as =sumif(condition range, 1, sum range) [learn how you can highlight alternative rows / columns in an excel table] [...]
GWBE
June 10th, 2008 at 10:15 am
48Hey Chandoo,
Stumbled here while reading one of your more recent entries.
Here’s my excel headache of the day - There seems to be a limit of 3 conditional formatting rules you can set up on a set of data. You can make it 4, if you take not having any rules set up as one of the rules.
What if I need to highlight 5 sets of data with 5 different colours? Is it possible through conditional formatting?
links for 2008-06-10 « Brent Sordyl’s Blog
June 10th, 2008 at 2:32 pm
49[...] Be an Excel Conditional Formatting Rock star I have created an excel sheet containing all these examples. Feel free to download the excel and be a conditional formatting rock star (tags: excel tips) Possibly related posts: (automatically generated)links for 2008-05-27links for 2008-05-22Flexible Rails Book - Part OneScaling to Enterprise [...]
Chandoo
June 11th, 2008 at 5:04 pm
50@Gaetan .. thanks for visiting PHD, I couldnt respond any earlier. Somehow I thought I had answered your query, my mistake. Well, As far as I know, its not possible to color different parts of a cell with different formats using conditional formatting or formulas. You can do this with VBA though.
A simple workaround could be to have another column next to the one with values solely to display arrows and use conditional formatting on it based on the values in the data column. I hope you are getting what I mean here… well, drop me another comment if you dont, I can write a post on how to use cond. formatting with data…
@GWBE .. thanks, well, you answered your question
if you need 5 or more conditional formats, you can either do it in google docs or write some vba. Now, vba option would require running the macro / sub every time you change your data which can be painful. I am thinking of writing a generic macro that can take formats from predefined cells (range) and apply it to data range based on the condition outcomes, but not sure its worth the pain.
One more ridiculously simple option you can try is using find/replace dialog to replace with your own format for cells meeting the find criteria. This way, first you need to define format for a cell in another column (that would purely contain values like 1,2,3,4,5,6,7,8,…n, each one defining one condition) and the search for cells matching 1 and replace them with format. This can be useful incase you need to format a table with more than 4-5 colors and need it urgent and for one time… otherwise vba is the best option…
@everyone.. let me know if you still need a soln. for more than 3 cond. formats, I can work on that generic vba soln. in my spare time
GWBE
June 13th, 2008 at 8:41 am
51Thanks man!
Sixfive
June 17th, 2008 at 2:36 am
52I have columns of numbers (a stat sheet). I’d like to highlight the max and min numbers (different colors) in each column to make the statistical leaders stand out. Is this possible using conditional formatting? I’ve used CF before but not to the extent you show. I appreciate any help/guidance.
Sixfive
June 17th, 2008 at 2:46 am
53Sorry…figured it out. =B1=max(b1…b9). This would determine if B1 was the max value from b1 to b9. Great site…
Chandoo
June 17th, 2008 at 1:16 pm
54@Sixfive … Its amazing you found the solution in 10 mins, I am happy my little site could help you in becoming more productive .. thanks for visiting PHD …
hamo
June 21st, 2008 at 11:29 am
55hi I need to know how work in excel environment and to be professional in using excel
Chandoo
June 23rd, 2008 at 1:55 pm
56@hamo.. you are at the right place… just keep visiting phd, may be you want to start with posts in excel category - http://chandoo.org/wp/category/excel/
Love Excel
June 24th, 2008 at 10:31 pm
57Love the tips you provided. It definitely helps, but it seems your information may be a bit advanced for first time users.
xRITE
July 5th, 2008 at 5:42 am
58test
Partition Charts in Excel - alternative to pie charts [visualization hack] | Pointy Haired Dilbert - Chandoo.org
July 9th, 2008 at 5:52 pm
59[...] This should be easy step, even if you are not a rock star of conditional formatting, [...]
colebro
July 13th, 2008 at 4:56 pm
60Chandoo, I have spreadsheet architectural diagram/map of hardware in our datacenter (SAN Directors and Storage Arrays). Each SAN Director has multiple storage array relationships (Directors ISL’d to multiple Arrays). I am looking for a way to highlight an Array or Director and all it’s relationships. Example: Enter in a serial # of an array and highlight that array box (serial# in cell), and the the SAN Director(s) and ISL’s that are related to the Array I am doing the search on. Conditional formatting is limitted to 3 conditions and I need many more than that. Any help would be appreciated.
Chandoo
July 14th, 2008 at 2:45 pm
61@Colebro: thanks for visiting PHD blog…
I am not able to visualize the problem you are having.. Do you mind sending some sample sheet to my email id… I can take a look at it during my spare time and get back to you
Otherwise, drop in another comment with a google docs link or images of the sheet…. so that I can answer your query…
RSS feed for comments on this post · TrackBack URI
Leave a reply
Welcome :)
Quick Facts
I am Chandoo, when I started this blog in 2004, the purpose was to post snapshots from hell to share my b-school life with world.
Today this blog has over 600 articles in topics like Excel, Business, Advertising, Technology, Photography and Life in Indian B-schools.
Interested? Know more or mail me at: chandoo [dot] d [at] gmail [dot] com
Recent Comments
Categories
Recently PHD wrote
Monthly Archives
Category-wise Archives
Blogroll
PHD Link Love
Hungry for Spam
Disclaimer
Add PHD to your news reader
Tag Cloud
advertising b-school blogging business chennai company cost engineering excel experience food Friends fun game holiday Humor idea ideas IIM images India Indore information learning management marketing MBA money movie office photos presentation process product project service story technology tips train travel tricks tv web weekendPointy Haired Dilbert - Chandoo.org is proudly powered by WordPress - BloggingPro theme by: Design Disease