#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Condition formula

I am trying to develop a formula that will provide me a color code based upon
the value of a given cell. For example if the value shown in cell A1 is
greater than -5% than the status is Blue. If the value in cell A1 is between
-5% and 5% than the status is Green. If the value in cell A1 is between 5%
and 10% than the status is Yellow. An finally, if the value in cell A1 is
greater than 10% than the status is red.
The status is based upon the variance of two numbers. Hope that makes sense.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Condition formula

Hi,

I believe that in Excel 2997 you can do this with conditional formaating but
I don't have that so have assumed 2003. Right click your sheet tab, view code
and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
Select Case Target.Value
Case Is 0.1
icolor = 3
Case Is = 0.05
icolor = 6
Case Is = -0.05
icolor = 4
Case Is < -0.05
icolor = 5
Case Else
icolor = xlNone
End Select
Target.Interior.ColorIndex = icolor
End Sub

Mike

"Herb" wrote:

I am trying to develop a formula that will provide me a color code based upon
the value of a given cell. For example if the value shown in cell A1 is
greater than -5% than the status is Blue. If the value in cell A1 is between
-5% and 5% than the status is Green. If the value in cell A1 is between 5%
and 10% than the status is Yellow. An finally, if the value in cell A1 is
greater than 10% than the status is red.
The status is based upon the variance of two numbers. Hope that makes sense.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Condition formula

what about using conditionally formatting the cells to reflect that
information Cell value is then the desired ranges

"Herb" wrote:

I am trying to develop a formula that will provide me a color code based upon
the value of a given cell. For example if the value shown in cell A1 is
greater than -5% than the status is Blue. If the value in cell A1 is between
-5% and 5% than the status is Green. If the value in cell A1 is between 5%
and 10% than the status is Yellow. An finally, if the value in cell A1 is
greater than 10% than the status is red.
The status is based upon the variance of two numbers. Hope that makes sense.

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
condition formula Kareinia Excel Worksheet Functions 5 March 8th 08 01:55 PM
MORE THAN ONE CONDITION IN A FORMULA CLM Excel Worksheet Functions 5 January 18th 07 01:21 PM
Formula For If & Or Condition anandmr65 Excel Discussion (Misc queries) 8 April 17th 06 10:40 AM
If formula and #N/A as a condition EstherJ Excel Discussion (Misc queries) 2 August 23rd 05 02:52 PM
Add condition to formula Pat Excel Worksheet Functions 0 November 16th 04 12:23 PM


All times are GMT +1. The time now is 01:13 PM.

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

About Us

"It's about Microsoft Excel"