Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How do I color cells within a formula in excel?
I am trying to format a cell so that if a value is greater than 5 the cell
will be coloured Red, if it is between 2 and 4 it will be Orange and if it is between zero and 1 it will be Green, how do I do it? I tried to use the IF function but it didn't seem to work. |
#2
|
|||
|
|||
Use FormatConditional formatting
-- Kind Regards, Niek Otten Microsoft MVP - Excel "Richard" wrote in message ... I am trying to format a cell so that if a value is greater than 5 the cell will be coloured Red, if it is between 2 and 4 it will be Orange and if it is between zero and 1 it will be Green, how do I do it? I tried to use the IF function but it didn't seem to work. |
#3
|
|||
|
|||
Look up 'Highlight cells that meet specific conditions' in the Answer
wizard in help -- HTH RP (remove nothere from the email address if mailing direct) "Niek Otten" wrote in message ... Use FormatConditional formatting -- Kind Regards, Niek Otten Microsoft MVP - Excel "Richard" wrote in message ... I am trying to format a cell so that if a value is greater than 5 the cell will be coloured Red, if it is between 2 and 4 it will be Orange and if it is between zero and 1 it will be Green, how do I do it? I tried to use the IF function but it didn't seem to work. |
#4
|
|||
|
|||
Hi Richard,
A bit more information, and suggest you read Conditional Formatting http://www.mvps.org/dmcritchie/excel/condfmt.htm FormatConditional formatting cond 1: =A1=5 format pattern for Red cond 2: =A1=2 format pattern for Orange cond 3: =A1=0 format pattern for Green Enter them in the above order because when you get a match the rest are going to be checked. The formula is based on your active cell, the cells that get colored are based on your selection. If you have more than 3 conditions you would need to use an Event Macro, and hopefully you would be working with constants rather than formulas so you can use a Change Event macro. http://www.mvps.org/dmcritchie/excel/event.htm With normal cell formatting instead you can try the following, but it will color ONLY the font, you cannot format the cell colour with normal cell formatting. The third part (all other numbers) will color negative numbers as well. Format cells Custom [Red][=5]General;[Color40][=2]General;[Color10]General;[Color30]@ Also on a laptop font colors are not very easily distinguishable, and dark colors are hard to distinguish for interior colors. Your colors if used for interior colors with Conditional Formatting would be easy to distinguish. More information on Colors http://www.mvps.org/dmcritchie/excel/colors.htm HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Niek Otten" wrote Use FormatConditional formatting "Richard" wrote... I am trying to format a cell so that if a value is greater than 5 the cell will be coloured Red, if it is between 2 and 4 it will be Orange and if it is between zero and 1 it will be Green, how do I do it? I tried to use the IF function but it didn't seem to work. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula in an Excel comment | Excel Discussion (Misc queries) | |||
Excel should have a simpler subtraction formula similar to "sum". | Excel Worksheet Functions | |||
How do I get the formula bar in excel 2003 | Excel Discussion (Misc queries) | |||
Need excel formula to display 28.50hrs in HRS & MINS? | Excel Worksheet Functions | |||
Suddenly Excel can't calculate formula!!! | Excel Worksheet Functions |