Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default Conditional Filtering

I have these 3 conditions I am trying to set my conditional filtering for:

1. if A1<C1 and A1<0 color the cell green
2. if A1C1 and A1<0 color the cell blue
3. if A1=0 color the cell black

Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Conditional Filtering

It is conditional formatting, not filtering.

You have the formulae, all you need to do is change Condition 1 (and 2 and
3) to Formula Is in CF then plug in each formula.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"carl" wrote in message
...
I have these 3 conditions I am trying to set my conditional filtering for:

1. if A1<C1 and A1<0 color the cell green
2. if A1C1 and A1<0 color the cell blue
3. if A1=0 color the cell black

Thank you in advance.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Debra Dalgleish
 
Posts: n/a
Default Conditional Filtering

To simplify the formulas, make #3 the first condition:

Cell Value Is equal to 0

Condition 2 (green): Formula Is =A1<C1

Condition 3 (blue): Formula Is =A1C1

If A1=C1, the cell won't be coloured.

carl wrote:
I have these 3 conditions I am trying to set my conditional filtering for:

1. if A1<C1 and A1<0 color the cell green
2. if A1C1 and A1<0 color the cell blue
3. if A1=0 color the cell black

Thank you in advance.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Martin
 
Posts: n/a
Default Conditional Filtering

I don't think conditional formatting's that clever.

Here's a macro that'll do the job - just make sure you select all the values
in column A before you run it:

Sub myConditionalFormat()
Dim myCell As Range
For Each myCell In Selection
If myCell.Value < myCell.Offset(0, 2).Value And myCell.Value < 0 Then
myCell.Interior.ColorIndex = 4
ElseIf myCell.Value myCell.Offset(0, 2).Value And myCell.Value <
0 Then
myCell.Interior.ColorIndex = 5
ElseIf myCell.Value = 0 Then
myCell.Interior.ColorIndex = 1
End If
Next
End Sub

If you haven't done macros before, go to the VB Editor (from Tools, Macro),
click on Insert, Module and then paste the above into it. To run it, select
your values in column A and then click Tools, Macro, Macros and double-click
myConditionalFormat in the list.


"carl" wrote:

I have these 3 conditions I am trying to set my conditional filtering for:

1. if A1<C1 and A1<0 color the cell green
2. if A1C1 and A1<0 color the cell blue
3. if A1=0 color the cell black

Thank you in advance.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Conditional Filtering

Novel approach, using VBA to do what CF does very easily.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Martin" wrote in message
...
I don't think conditional formatting's that clever.

Here's a macro that'll do the job - just make sure you select all the

values
in column A before you run it:

Sub myConditionalFormat()
Dim myCell As Range
For Each myCell In Selection
If myCell.Value < myCell.Offset(0, 2).Value And myCell.Value < 0

Then
myCell.Interior.ColorIndex = 4
ElseIf myCell.Value myCell.Offset(0, 2).Value And myCell.Value

<
0 Then
myCell.Interior.ColorIndex = 5
ElseIf myCell.Value = 0 Then
myCell.Interior.ColorIndex = 1
End If
Next
End Sub

If you haven't done macros before, go to the VB Editor (from Tools,

Macro),
click on Insert, Module and then paste the above into it. To run it,

select
your values in column A and then click Tools, Macro, Macros and

double-click
myConditionalFormat in the list.


"carl" wrote:

I have these 3 conditions I am trying to set my conditional filtering

for:

1. if A1<C1 and A1<0 color the cell green
2. if A1C1 and A1<0 color the cell blue
3. if A1=0 color the cell black

Thank you in advance.



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 if or filtering in pivot table P Boric Excel Worksheet Functions 2 March 7th 06 11:18 PM
Conditional Format Not Working KMH Excel Discussion (Misc queries) 0 December 22nd 05 05:32 PM
how do I maintain my conditional formatting when filtering cells? Aja Excel Worksheet Functions 0 September 21st 05 09:56 PM
Filtering out text with conditional formatting bluebean Excel Discussion (Misc queries) 4 August 5th 05 04:43 PM
Conditional Filtering carl Excel Worksheet Functions 2 June 10th 05 01:58 AM


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