Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Phillip Bruce
 
Posts: n/a
Default conditional formatting

How can I format a cell based on the color fill of another cell?

Also, how could I add up all the cells that contain a certain color fill?
  #2   Report Post  
Phil Wales
 
Posts: n/a
Default

In your first cell type in e.g.
r for red
g for green

Then do a conditional format on cell 1 to say if cell = r then format it
font red & pattern red.... then add 2nd condition if cell = g then
format it font green & pattern green.. this will change it a particular
colour.

Then in your 2nd cell type in = the 1st cell. this will then have either
a letter r or g appearing. Then just do exactly the same conditional format
conditions as you did in 1st cell.

To add up all the r's do a sumif( ) = r



"Phillip Bruce" wrote:

How can I format a cell based on the color fill of another cell?

Also, how could I add up all the cells that contain a certain color fill?

  #3   Report Post  
Phillip Bruce
 
Posts: n/a
Default

Thank you for the advice, but for my example these steps do not work. First,
cell 1 must = a value, not "r" or "g" in order to keep the integrity of the
worksheet.

Secondly, the 2nd cell must also be a number (or formula) in order to sum
the cells. I cannot change this cell to "r" or "g" either. The conditional
formatting must be based solely on the fill colour of the 1st cell, not on a
value or formula.

"Phil Wales" wrote:

In your first cell type in e.g.
r for red
g for green

Then do a conditional format on cell 1 to say if cell = r then format it
font red & pattern red.... then add 2nd condition if cell = g then
format it font green & pattern green.. this will change it a particular
colour.

Then in your 2nd cell type in = the 1st cell. this will then have either
a letter r or g appearing. Then just do exactly the same conditional format
conditions as you did in 1st cell.

To add up all the r's do a sumif( ) = r



"Phillip Bruce" wrote:

How can I format a cell based on the color fill of another cell?

Also, how could I add up all the cells that contain a certain color fill?

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

How is the fill for the first set of cells changed?

Did you use format|conditional formatting for those, too?

If no (you just formatted the cell), you can use a userdefined function to
return the value for the color of the fill.

See Chip Pearson's site for a nice version:
http://www.cpearson.com/excel/colors.htm
Look for: Returning The ColorIndex Of A Cell

Then you could use that UDF in your formula for the conditional formatting for
the other cells.

==========
On the other hand, if you used Format|conditional formatting to color the fill
of the first set of cells, then the code is not for the faint of heart.

Visit Chip Pearson's site for more info:
http://www.cpearson.com/excel/CFColors.htm

====

If possible, I'd try to use a helper cell that mimicked the conditional
formatting formula, then use that cell in the next set of format|conditional
formatting.




Phillip Bruce wrote:

Thank you for the advice, but for my example these steps do not work. First,
cell 1 must = a value, not "r" or "g" in order to keep the integrity of the
worksheet.

Secondly, the 2nd cell must also be a number (or formula) in order to sum
the cells. I cannot change this cell to "r" or "g" either. The conditional
formatting must be based solely on the fill colour of the 1st cell, not on a
value or formula.

"Phil Wales" wrote:

In your first cell type in e.g.
r for red
g for green

Then do a conditional format on cell 1 to say if cell = r then format it
font red & pattern red.... then add 2nd condition if cell = g then
format it font green & pattern green.. this will change it a particular
colour.

Then in your 2nd cell type in = the 1st cell. this will then have either
a letter r or g appearing. Then just do exactly the same conditional format
conditions as you did in 1st cell.

To add up all the r's do a sumif( ) = r



"Phillip Bruce" wrote:

How can I format a cell based on the color fill of another cell?

Also, how could I add up all the cells that contain a certain color fill?


--

Dave Peterson
  #5   Report Post  
Phillip Bruce
 
Posts: n/a
Default

Is there any other way to accomplish without using a macro or VBA or UDF?

I find your instructions on your link very confusing and complicated.
Frankly, I'd rather do everything by hand if I have to go through that much
trouble to create a macro etc.

"Dave Peterson" wrote:

How is the fill for the first set of cells changed?

Did you use format|conditional formatting for those, too?

If no (you just formatted the cell), you can use a userdefined function to
return the value for the color of the fill.

See Chip Pearson's site for a nice version:
http://www.cpearson.com/excel/colors.htm
Look for: Returning The ColorIndex Of A Cell

Then you could use that UDF in your formula for the conditional formatting for
the other cells.

==========
On the other hand, if you used Format|conditional formatting to color the fill
of the first set of cells, then the code is not for the faint of heart.

Visit Chip Pearson's site for more info:
http://www.cpearson.com/excel/CFColors.htm

====

If possible, I'd try to use a helper cell that mimicked the conditional
formatting formula, then use that cell in the next set of format|conditional
formatting.




Phillip Bruce wrote:

Thank you for the advice, but for my example these steps do not work. First,
cell 1 must = a value, not "r" or "g" in order to keep the integrity of the
worksheet.

Secondly, the 2nd cell must also be a number (or formula) in order to sum
the cells. I cannot change this cell to "r" or "g" either. The conditional
formatting must be based solely on the fill colour of the 1st cell, not on a
value or formula.

"Phil Wales" wrote:

In your first cell type in e.g.
r for red
g for green

Then do a conditional format on cell 1 to say if cell = r then format it
font red & pattern red.... then add 2nd condition if cell = g then
format it font green & pattern green.. this will change it a particular
colour.

Then in your 2nd cell type in = the 1st cell. this will then have either
a letter r or g appearing. Then just do exactly the same conditional format
conditions as you did in 1st cell.

To add up all the r's do a sumif( ) = r



"Phillip Bruce" wrote:

How can I format a cell based on the color fill of another cell?

Also, how could I add up all the cells that contain a certain color fill?


--

Dave Peterson



  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

No matter which way the cells are formatted (manually or via conditional
formatting), you need some kind of VBA to get the color.

Phillip Bruce wrote:

Is there any other way to accomplish without using a macro or VBA or UDF?

I find your instructions on your link very confusing and complicated.
Frankly, I'd rather do everything by hand if I have to go through that much
trouble to create a macro etc.

"Dave Peterson" wrote:

How is the fill for the first set of cells changed?

Did you use format|conditional formatting for those, too?

If no (you just formatted the cell), you can use a userdefined function to
return the value for the color of the fill.

See Chip Pearson's site for a nice version:
http://www.cpearson.com/excel/colors.htm
Look for: Returning The ColorIndex Of A Cell

Then you could use that UDF in your formula for the conditional formatting for
the other cells.

==========
On the other hand, if you used Format|conditional formatting to color the fill
of the first set of cells, then the code is not for the faint of heart.

Visit Chip Pearson's site for more info:
http://www.cpearson.com/excel/CFColors.htm

====

If possible, I'd try to use a helper cell that mimicked the conditional
formatting formula, then use that cell in the next set of format|conditional
formatting.




Phillip Bruce wrote:

Thank you for the advice, but for my example these steps do not work. First,
cell 1 must = a value, not "r" or "g" in order to keep the integrity of the
worksheet.

Secondly, the 2nd cell must also be a number (or formula) in order to sum
the cells. I cannot change this cell to "r" or "g" either. The conditional
formatting must be based solely on the fill colour of the 1st cell, not on a
value or formula.

"Phil Wales" wrote:

In your first cell type in e.g.
r for red
g for green

Then do a conditional format on cell 1 to say if cell = r then format it
font red & pattern red.... then add 2nd condition if cell = g then
format it font green & pattern green.. this will change it a particular
colour.

Then in your 2nd cell type in = the 1st cell. this will then have either
a letter r or g appearing. Then just do exactly the same conditional format
conditions as you did in 1st cell.

To add up all the r's do a sumif( ) = r



"Phillip Bruce" wrote:

How can I format a cell based on the color fill of another cell?

Also, how could I add up all the cells that contain a certain color fill?


--

Dave Peterson


--

Dave Peterson
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 Error ddate Excel Worksheet Functions 0 May 5th 05 09:00 PM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
conditional formatting question Deb Excel Discussion (Misc queries) 0 March 23rd 05 02:07 AM
Determine cells that drive conditional formatting? Nicolle K. Excel Discussion (Misc queries) 2 January 7th 05 01:08 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


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