Cell coloring

P

Peter

I have one cell that is the date plus 1. What I need to do if the cell's date
is Sun or Mon then I want it to change the background to green. If it is Wed
or Thurs I want it to be blue. If it is a Tue. Fri or Sat I want it to be
white. I have tried many different formulas to change this and still can't
figure it out. Any help is appreciated.
 
R

Rick Rothstein

Patience Peter, patience... you need to give people more than 7 minutes to
react to your posting, especially on a weekend.

The answer to your question is to use Conditional Formatting. Select the
cell you want to have this functionality (I'll assume it is A1 since you
didn't tell us which cell it is... change my A1 addresses to the actual
address you want in the formulas below), click Format/Conditional Formatting
on the menu bar. On the dialog box that appears, click the Add button... you
will have two Conditions shown. Do this for Condition 1... change the first
drop down to "Formula Is" and copy paste this formula into the empty field
next to it...

=WEEKDAY(A1)<3

Then click the Format button and click on the Patterns tab, select a green
color from the table and click OK. Now, do the same thing for Condition 2,
except use this formula for it...

=OR(WEEKDAY(A1)=4,WEEKDAY(A1)=5)

and choose a blue color on the Patterns tab this time. OK your way back to
the worksheet.
 
M

Mike H

Peter,

As white is default you need 2 conditional format formula

For Sunday & Monday

=WEEKDAY($A$1)<3

For Wed & Thu

=OR(WEEKDAY($A$1)=4,WEEKDAY($A$1)=5)

Mike
 
S

Shane Devenshire

Hi,

Another formula approach that will work is:
for Sunday and Monday use this formula

=MOD(A1-1,7)<2

For Wednesday and Thursday use

=OR(MOD(A1-1,7)=3,MOD(A1-1,7)=4)

For the rest of the days nothing since you want white.

To conditionally format your cell(s):

In 2003:
1. Select the cells you want to format (column C)
2. Choose Format, Conditional Formatting
3. Choose Formula is from the first drop down
4. In the second box enter the formula:
1st formula above
5. Click the Format button
6. Choose a color on the Patterns tab (or any available option)
7. Click OK one.
8. Click Add
9. For Condition 2, from the first drop down pick Formula is
10. In the second box enter the formula:
2nd formula above
11. Click the Format button
1. Choose a color and click OK twice.

In 2007:
1. Highlight all the cells on the rows you want formatted
2. Choose Home, Conditional Formatting, Manage Rules, New Rule
3. Choose Use a formula to determine which cell to format
4. In the Format values where this formula is true enter the following
formula:
first formula above
5. Click the Format button and choose a format.
6. Click OK twice
7. New Rule
8. Choose Use a formula to determine which cell to format
9. In the Format values where this formula is true enter the following
formula:
second formula above
10. Click the Format button and choose a format.
11. Click OK tree times.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cell color 1
Cell Colors 2
Conditional Formatting 6
vlookup help? 7
Dcounta 4
Payroll 1
Complex formulas 3
Sorting day names chronologically 5

Top