Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've recently been asked to create some conditional formatting based
on a cell value. Basically what I am trying to do is have the cell turn red if the value of a cell is outside of a range. For example, if the value of cell F12 280 OR < 220 then I want the cell to turn red. The standard conditional formatting has limitations so I am left to figure out how to write a formula. Can someone assist me with this? Here is what I have so far but it does not seem to be working. =IF(F12280 OR <220) then????? Thanks in advance for your help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Test()
With ActiveSheet.Range("A1").FormatConditions .Delete .Add Type:=xlExpression, _ Formula1:="=OR($F$12<220,$F$12280)" .Item(1).Interior.ColorIndex = 3 End With End Sub Change "A1" to the cell address in which you want the FC Regards, Peter T wrote in message ... I've recently been asked to create some conditional formatting based on a cell value. Basically what I am trying to do is have the cell turn red if the value of a cell is outside of a range. For example, if the value of cell F12 280 OR < 220 then I want the cell to turn red. The standard conditional formatting has limitations so I am left to figure out how to write a formula. Can someone assist me with this? Here is what I have so far but it does not seem to be working. =IF(F12280 OR <220) then????? Thanks in advance for your help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Justin
The formula that Peter is using in is Macro can also be used in Conditional Formatting. Your choice a macro that will do the job for you or you type it in yourself. Regards John wrote in message ... I've recently been asked to create some conditional formatting based on a cell value. Basically what I am trying to do is have the cell turn red if the value of a cell is outside of a range. For example, if the value of cell F12 280 OR < 220 then I want the cell to turn red. The standard conditional formatting has limitations so I am left to figure out how to write a formula. Can someone assist me with this? Here is what I have so far but it does not seem to be working. =IF(F12280 OR <220) then????? Thanks in advance for your help. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I should have thought to mention the macro only does what is typically done
manually. Apart from the formula that can be directly copied from the example macro, need to select "Formula Is" in the left dropdown in the CF dialog. Regards Peter T "John" wrote in message ... Hi Justin The formula that Peter is using in is Macro can also be used in Conditional Formatting. Your choice a macro that will do the job for you or you type it in yourself. Regards John wrote in message ... I've recently been asked to create some conditional formatting based on a cell value. Basically what I am trying to do is have the cell turn red if the value of a cell is outside of a range. For example, if the value of cell F12 280 OR < 220 then I want the cell to turn red. The standard conditional formatting has limitations so I am left to figure out how to write a formula. Can someone assist me with this? Here is what I have so far but it does not seem to be working. =IF(F12280 OR <220) then????? Thanks in advance for your help. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 26, 12:46*pm, "Peter T" <peter_t@discussions wrote:
I should have thought to mention the macro only does what is typically done manually. Apart from the formula that can be directly copied from the example macro, need to select "Formula Is" in the left dropdown in the CF dialog. Regards Peter T "John" wrote in message ... Hi Justin The formula that Peter is using in is Macro can also be used in Conditional Formatting. Your choice a macro that will do the job for you or you type it in yourself. Regards John wrote in message .... I've recently been asked to create some conditional formatting based on a cell value. Basically what I am trying to do is have the cell turn red if the value of a cell is outside of a range. For example, if the value of cell F12 280 OR < 220 then I want the cell to turn red. The standard conditional formatting has limitations so I am left to figure out how to write a formula. Can someone assist me with this? Here is what I have so far but it does not seem to be working. =IF(F12280 OR <220) then????? Thanks in advance for your help.- Hide quoted text - - Show quoted text - Thanks to everyone for your help. One thing that I have noticed is that Cell F12 is actually pulling it's value from a second sheet. When I select cell F12 I get the following in the formula bar - ='Sheet2'!E8 Since cell F12 does not contain a real value, how can I write the formula to look at 'Sheet2'!E8 and if it meets the previously mentioned critera then turn cell F12 on Sheet 1 red? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
wrote in message:
When I select cell F12 I get the following in the formula bar - ='Sheet2'!E8 Since cell F12 does not contain a real value, how can I write the formula to look at 'Sheet2'!E8 and if it meets the previously mentioned critera then turn cell F12 on Sheet 1 red Even if F12 contains a formula that refers to a cell on another sheet it also contains a value (as returned by the formula). Normally this should not make any difference to the way to add the CF formula as suggested (although in some scenarios the order of calculation may affect things). In an FC formula you can't refer directly to a cell on another sheet, at least not directly. The workaround is to incorporate the Indirect function. Though in this case that shouldn't be necessary, simply refer to the formula cell F12. Regards, Peter T |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 26, 2:13*pm, "Peter T" <peter_t@discussions wrote:
wrote in message: When I select cell F12 I get the following in the formula bar - ='Sheet2'!E8 Since cell F12 does not contain a real value, how can I write the formula to look at 'Sheet2'!E8 and if it meets the previously mentioned critera then turn cell F12 on Sheet 1 red Even if F12 contains a formula that refers to a cell on another sheet it also contains a value (as returned by the formula). Normally this should not make any difference to the way to add the CF formula as suggested (although in some scenarios the order of calculation may affect things). In an FC formula you can't refer directly to a cell on another sheet, at least not directly. The workaround is to incorporate the Indirect function. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formatting Formula? | Excel Worksheet Functions | |||
conditional formatting OR formula | Excel Discussion (Misc queries) | |||
Conditional Formatting Formula | Excel Worksheet Functions | |||
conditional formatting with formula | Excel Worksheet Functions | |||
Conditional Formatting Formula | Excel Programming |