Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
W W is offline
external usenet poster
 
Posts: 35
Default Correct Syntax for Changing Color of Cell Based on Value

I have a column with percentages in it, and I want to have the color of each
cell change based on values. If the percentage is greater than 50 then I
want Blue. If the percentage is 25 to 50 I want red. If the Percentage
is less than 25 I want black. I guessed at the following syntax for a
Custom number type, but Excel is rejecting this:

[Blue][50]Percentage;[Red][25]Percentage; Percentage

What would be the correct syntax?

A further refinement on this is that I don't want more than one tenth of one
percent precision, so the template would be 00.0%.

--
W


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Correct Syntax for Changing Color of Cell Based on Value

Maybe something like:
[Blue][0.5]0.00%;[Red][0.25]0.00%;0.00%

(notice that the numbers are now decimals--not whole numbers.)


W wrote:

I have a column with percentages in it, and I want to have the color of each
cell change based on values. If the percentage is greater than 50 then I
want Blue. If the percentage is 25 to 50 I want red. If the Percentage
is less than 25 I want black. I guessed at the following syntax for a
Custom number type, but Excel is rejecting this:

[Blue][50]Percentage;[Red][25]Percentage; Percentage

What would be the correct syntax?

A further refinement on this is that I don't want more than one tenth of one
percent precision, so the template would be 00.0%.

--
W


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Correct Syntax for Changing Color of Cell Based on Value

: [Blue][0.5]0.0%;[Red][0.25]0.0%;0.0%

(I didn't notice the last sentence of your original post.)


W wrote:

I have a column with percentages in it, and I want to have the color of each
cell change based on values. If the percentage is greater than 50 then I
want Blue. If the percentage is 25 to 50 I want red. If the Percentage
is less than 25 I want black. I guessed at the following syntax for a
Custom number type, but Excel is rejecting this:

[Blue][50]Percentage;[Red][25]Percentage; Percentage

What would be the correct syntax?

A further refinement on this is that I don't want more than one tenth of one
percent precision, so the template would be 00.0%.

--
W


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Correct Syntax for Changing Color of Cell Based on Value

Use conditional formatting.

In Excel versions 2003 and befo

Select the range of cells you want to format. Assume this range is A1:A10.
Goto the menu FormatConditional Formatting
Use the Formula Is option
Condition 1
Formula Is: =A10.5
Click the Format button
Select the Font tab
Set the color to BLUE
OK
Click the Add button
Condition 2
Formula Is: =A1=0.25
Click the Format button
Select the Font tab
Set the color to RED
OK out

--
Biff
Microsoft Excel MVP


"W" wrote in message
...
I have a column with percentages in it, and I want to have the color of
each
cell change based on values. If the percentage is greater than 50 then I
want Blue. If the percentage is 25 to 50 I want red. If the Percentage
is less than 25 I want black. I guessed at the following syntax for a
Custom number type, but Excel is rejecting this:

[Blue][50]Percentage;[Red][25]Percentage; Percentage

What would be the correct syntax?

A further refinement on this is that I don't want more than one tenth of
one
percent precision, so the template would be 00.0%.

--
W




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
Changing text color based upon If KenM Excel Discussion (Misc queries) 5 November 24th 08 08:56 PM
Changing a color in a cell based on the text in another cell Ryan Excel Discussion (Misc queries) 3 November 13th 08 10:17 PM
Excel: Syntax to change cell color based on color of another cell davew18 Excel Worksheet Functions 1 January 4th 07 01:24 PM
Changing background color based on different cell djarcadian Excel Discussion (Misc queries) 3 August 10th 06 10:44 PM
changing value of a cell based on another cell color Gary Excel Discussion (Misc queries) 2 January 30th 05 10:19 AM


All times are GMT +1. The time now is 11:14 PM.

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"