Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Formula for Conditional Formatting

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Formula for Conditional Formatting

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Formula for Conditional Formatting

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Formula for Conditional Formatting

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Formula for Conditional Formatting

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Formula for Conditional Formatting

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Formula for Conditional Formatting

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
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
Conditional Formatting Formula? Doug Excel Worksheet Functions 5 August 6th 09 04:12 AM
conditional formatting OR formula SandyB Excel Discussion (Misc queries) 1 May 29th 08 07:41 PM
Conditional Formatting Formula DHEvans333 Excel Worksheet Functions 1 November 9th 06 08:51 PM
conditional formatting with formula mwc0914 Excel Worksheet Functions 2 July 20th 05 08:11 PM
Conditional Formatting Formula dmorri Excel Programming 9 July 29th 04 04:09 PM


All times are GMT +1. The time now is 02:53 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"