Conditional Formating based on Odd vs. Even

N

natei6

Hi

If row in column A contains an even number, shade that row in Colum
B-G Yellow, If odd Shade Gray, If blank No Shade. Can this be done i
a formula in Conditional Formatting? If so, how? Help appreciated.

Nathan Sargean
 
B

Bob Umlas

Sure.
Select B:G
Condition 1: Formula is =Len($A1)=0 (no format)
Condition 2: Formula is =MOD($A1,2)=0 (yellow format)
Condition 3: FOrmula is : =MOD($A1,2)=1 (grey format)

Bob Umlas
Excel MVP
 
J

Jason Morin

1. Select columns B though G.
2. Format > Conditional Formatting
3. Formula Is:
=MOD($A1,2)=0
4. Press the "Format" button
5. Select the "Pattern" tab and select yellow - press OK
6. Click "Add>>".
7. Formula Is:
=MOD($A1,2)=1
8. Repeat step 4 and 5 - select Grey.

HTH
Jason
Atlanta, GA
 
N

natei6

To all the excel gods

Thanks for the help, it almost works perfectly. The only problem is
it makes the cells yellow if column A is blank. It should return n
format. More suggestions appreciated.

All the best

Nathan Sargean
 
J

Jason Morin

Change =MOD($A1,2)=0 to:

=AND(MOD($A1,2)=0,$A1<>"")

and =MOD($A1,2)=1 to:

=AND(MOD($A1,2)=1,$A1<>"")

HTH
Jason
Atlanta, GA
 
N

natei6

Hello

Thats great! I have one more question, How do I amend it to render n
format if Column J is blank. I've tried several things, no success.

Thanks

Nathan Sargean
 
N

natei6

Hello

Thats great! I have one more question, How do I amend it to render n
format if Column J is blank. I've tried several things, no success.

Thanks

Nathan Sargeant
 
D

Dave Peterson

Keep on adding those conditions:

=AND(MOD($A1,2)=0,$A1<>"",$J1<>"")

and the same for the second one.
 
N

natei6

Thank you That worked great!

Nathan Sargeant


Dave said:
*Keep on adding those conditions:

=AND(MOD($A1,2)=0,$A1<>"",$J1<>"")

and the same for the second one.
 

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

Top