Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / June 2006

Tip: Looking for answers? Try searching our database.

Conditional Formatting Formula to Color Rows Based on Column Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SteveC - 26 Jun 2006 16:29 GMT
I've tried, but I can't figure it out.  How to use conditional formatting to
alternatively color rows based on values in a column?  

For example, in B13:B3000, I have values like this:

Col B           Row color I'd lilke
Apples         Green
Apples         Green
Pears           White
Pears            White
Pears           White
Pears           White
Bananas       Green
Monkeys       White
Monkeys       White
Giraffes        Green     etc...

Thanks for your help...
SteveC - 26 Jun 2006 17:56 GMT
http://www.mvps.org/dmcritchie/excel/condfmt.htm

Found the answer --> you need a helper column, unfortunately...

> I've tried, but I can't figure it out.  How to use conditional formatting to
> alternatively color rows based on values in a column?  
[quoted text clipped - 14 lines]
>
> Thanks for your help...
Gary L Brown - 26 Jun 2006 18:23 GMT
2 ways of doing this.
1)  Use a 'cheat' column and conditional formatting.
 Advantage:  If the data changes, the formatting changes.
 Disadvantage:  Having an extra column with a formula
2)  Use a macro.
 Advantage:  No extra columns or formulas to maintain.
 Disadvantage:  If the data changes, the formatting doesn't change unless
the macro is re-run.

Using option 1...
- Insert a blank column in Column A
- In Cell A1, put the number 1
- in Cell A2, put the formula...
 =IF(C2=C1,A1,A1*-1)
 It is comparing Apples to Pears to Bananas to Monkeys to find out when the
data changes.  The value in column A will change from 1 to -1 everytime the
data switches from apples to pears, etc.
- Copy the formula in A2 down to the bottom of the data.
- Create the conditional formatting...
 - highlight the entire worksheet
 - Format>Conditional Formatting...
 - Condition 1:  Formula is
                 =$A1:$A1=1
 - Format>Patterns>Green
- All rows that have a '1' in Column A will now turn green.

HTH,
Signature

Gary Brown
gary_brown@ge_NOSPAM.com
If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.

> I've tried, but I can't figure it out.  How to use conditional formatting to
> alternatively color rows based on values in a column?  
[quoted text clipped - 14 lines]
>
> Thanks for your help...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.