Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Richard
 
Posts: n/a
Default 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   Report Post  
Niek Otten
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
David McRitchie
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula in an Excel comment The Window Cleaner Excel Discussion (Misc queries) 0 March 10th 05 11:03 AM
Excel should have a simpler subtraction formula similar to "sum". Darius Excel Worksheet Functions 5 February 21st 05 11:14 PM
How do I get the formula bar in excel 2003 unionhall Excel Discussion (Misc queries) 1 February 17th 05 10:10 AM
Need excel formula to display 28.50hrs in HRS & MINS? rbc Excel Worksheet Functions 4 January 6th 05 12:21 PM
Suddenly Excel can't calculate formula!!! Bob H Excel Worksheet Functions 2 November 30th 04 08:35 PM


All times are GMT +1. The time now is 04:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"