# Multiple condition formating

1. ## Multiple condition formating

I'm trying to do conditional formatting based on multiple conditions. I would like to have cell C4 turn green if any of these conditions are meet. D61=0 and D4>0 or E61=0 and E4>0….R61=0 and R4>0(for every column from D to R). If possible I would like for cell C4 turn red instead of green if more than one of these are true. I have tried a few different formulas and the closest I came would only turn C4 green if the D61=0 and D4>0 was true. Anything else didn't change the color. I know I could make multiple rules for cell C4 but would rater have 1 rule with a formula if possible.

2. ## Re: Multiple condition formating

I think you're not going to get away from having two different tests, one for each color; conditional formatting by formula can only apply one format, not a range.

Anyway, since you've got a stack of OR(AND) all nested in a row, you can actually use addition with SUMPRODUCT on your logical conditions instead of just nesting a load of boolean functions.

Format where this formula is true to turn a cell "green" when exactly one pair meets the criteria:
``Please Login or Register  to view this content.``
Put this conditional above it to change the cell to "red" when more than one pair meets the criteria:
``Please Login or Register  to view this content.``
So that one will go higher in the list, and click the checkbox "Stop if True" in the "Conditional Formatting Rules Manager" dialogue box.

3. ## Re: Multiple condition formating

Thank you. I had to do a slight modification to your formula but it seems to work.I still have a lot of testing to do because I want to apply this to other cells than C4 but it will be the same logic so should work.I will report back after more testing. Thanks again and her is what I had to do.

To turn the cell green
HTML Code:
``=SUMPRODUCT( --(D61:R61 = 0), --(D10:R10 > 0)) = 1``
To turn the cell red

HTML Code:
``=SUMPRODUCT( --(D61:R61 = 0), --(D10:R10 > 0)) = 1``

4. ## Re: Multiple condition formating

Those are the exact same formula, aren't they? Won't it just apply both conditional formats and just keep whichever one happened to be applied last?

5. ## Re: Multiple condition formating

Opps. paste the wrong code i used for red.
HTML Code:
``=SUMPRODUCT( --(\$D\$61:\$R\$61 = 0), --(D10:R10 > 0)) > 1``

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1