Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Color Coding cell based on date (over a large range)

I have a "calendar" that I want cells color coded based on a date entered in
a reference cell. I've tried it a couple of ways using conditional
formatting (which I assume is the correct way to do it), but can't figure out
exactly how to accomplish it.

I.e., given the following type of spreadsheet entry...

A B C D E F G H I J K
1 JANUARY
2 1 2 3 4 5 6 7 8 9 ...
3 _ _ _ _ _ _ _ _ _

(C3 would be Jan 1, D3 would be Jan 2, etc)

If a reference cell has Jan 1 in it, then C3 would be highlighted a color ..
if it had Jan 2 in it, then D3 would be .. etc.

Furthermore, this would be used over many rows (i.e., a date entry for row 3
... one for row 4 .. etc)

Any help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default Color Coding cell based on date (over a large range)

Using your sample of 9 dates in C3:K3

A1:A9 have dates Jan 1 though Jan 9

Select C3:K12 and CFFormula is:

=C3=$A1 Format to a color and OK


Gord Dibben MS Excel MVP

On Tue, 26 Jan 2010 11:52:01 -0800, Randy1360
wrote:

I have a "calendar" that I want cells color coded based on a date entered in
a reference cell. I've tried it a couple of ways using conditional
formatting (which I assume is the correct way to do it), but can't figure out
exactly how to accomplish it.

I.e., given the following type of spreadsheet entry...

A B C D E F G H I J K
1 JANUARY
2 1 2 3 4 5 6 7 8 9 ...
3 _ _ _ _ _ _ _ _ _

(C3 would be Jan 1, D3 would be Jan 2, etc)

If a reference cell has Jan 1 in it, then C3 would be highlighted a color ..
if it had Jan 2 in it, then D3 would be .. etc.

Furthermore, this would be used over many rows (i.e., a date entry for row 3
.. one for row 4 .. etc)

Any help would be appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 563
Default Color Coding cell based on date (over a large range)

InA1 I have a date 3/1/2010 (I use the dd/mm/yyyy format) but the cell is
formatted to display 3-Jan
I selected C3:AG3 and applied this formula in the Conditional Formatting
dialog:
=AND(MONTH($A$1)=1, DAY($A$1)=C2)
and set a colour for the fill

Note the C2 (without $); this is the first cell in my selection. It has the
value 1
In I look at the conditional formatting for D3 it will read
=AND(MONTH($A$1)=1, DAY($A$1)=D2)

Since the DAY of A1 is 3, the cell E3 gets the colour fill. I I enter 28-Feb
nothing gets the fill since MONTH of A1 will then be 2.

You should be able to adapt this for the rest of your calendar.

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Randy1360" wrote in message
...
I have a "calendar" that I want cells color coded based on a date entered
in
a reference cell. I've tried it a couple of ways using conditional
formatting (which I assume is the correct way to do it), but can't figure
out
exactly how to accomplish it.

I.e., given the following type of spreadsheet entry...

A B C D E F G H I J K
1 JANUARY
2 1 2 3 4 5 6 7 8 9 ...
3 _ _ _ _ _ _ _ _ _

(C3 would be Jan 1, D3 would be Jan 2, etc)

If a reference cell has Jan 1 in it, then C3 would be highlighted a color
..
if it had Jan 2 in it, then D3 would be .. etc.

Furthermore, this would be used over many rows (i.e., a date entry for row
3
.. one for row 4 .. etc)

Any help would be appreciated.


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Color Coding cell based on date (over a large range)

Thanks Bernard .. that got me rolling.

One change I made to yours is using a relative reference to the column
instead of an absolute for the source cell:

=AND(MONTH($A1)=1, DAY($A1)=C2)

This allows me to copy the conditional formatting across for the entire
month and only the day entered in the source cell will be highlighted.

Follow-on question: I have the month spelled out in a combined cell above
the dates (i.e., M1:AQ1 has JANUARY, AR1:BS2 has FEBRUARY, etc). Can I
change the MONTH value (i.e., 1, 2, 3, etc) based on a formula converting the
text? If so, how could you reference the month text in a combined cell
easily to do the calculation?

If the above can be done, then I can just copy the formatting to the end of
the year and not have to change the formatting for each month.

Thanks again!

"Bernard Liengme" wrote:

InA1 I have a date 3/1/2010 (I use the dd/mm/yyyy format) but the cell is
formatted to display 3-Jan
I selected C3:AG3 and applied this formula in the Conditional Formatting
dialog:
=AND(MONTH($A$1)=1, DAY($A$1)=C2)
and set a colour for the fill

Note the C2 (without $); this is the first cell in my selection. It has the
value 1
In I look at the conditional formatting for D3 it will read
=AND(MONTH($A$1)=1, DAY($A$1)=D2)

Since the DAY of A1 is 3, the cell E3 gets the colour fill. I I enter 28-Feb
nothing gets the fill since MONTH of A1 will then be 2.

You should be able to adapt this for the rest of your calendar.

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Randy1360" wrote in message
...
I have a "calendar" that I want cells color coded based on a date entered
in
a reference cell. I've tried it a couple of ways using conditional
formatting (which I assume is the correct way to do it), but can't figure
out
exactly how to accomplish it.

I.e., given the following type of spreadsheet entry...

A B C D E F G H I J K
1 JANUARY
2 1 2 3 4 5 6 7 8 9 ...
3 _ _ _ _ _ _ _ _ _

(C3 would be Jan 1, D3 would be Jan 2, etc)

If a reference cell has Jan 1 in it, then C3 would be highlighted a color
..
if it had Jan 2 in it, then D3 would be .. etc.

Furthermore, this would be used over many rows (i.e., a date entry for row
3
.. one for row 4 .. etc)

Any help would be appreciated.


.

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
How to Color a Cell Based on a Range of Cells with Colors ron weasley Excel Worksheet Functions 1 January 13th 10 01:05 AM
In excel change color of a range of cells based on a cell value kwitt Excel Worksheet Functions 1 November 18th 09 07:20 PM
Backgroud color for 1 cell based on a range of cells values schmill Excel Discussion (Misc queries) 3 July 29th 09 02:18 AM
Formatting the color of a range of cells based on the value of one cell [email protected] Excel Worksheet Functions 3 October 20th 06 07:04 PM
How do I change cell color based upon data range within the cell? Chris Sanders Excel Worksheet Functions 1 March 6th 06 08:59 PM


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