Using wildcards with logical (IF, AND) conditional formatting

O

olddog

I have two columns: A & B. Assume A contains a combinaton of numbers and
letters (e.g. 13.00.10i.022) and is formated as "General." Column B is a
whole number between 1 and 3. I would like to create a Conditional Format
formula that says "IF B=1 AND A does NOT begin with the number "12", then
color that ROW red. Continuing, "IF B=1 AND A DOES begin with the number
"12," then do nothing (no color format). How do I do this?

Thanks !
 
G

Gord Dibben

CF>Formula is =AND(B1=1,LEFT(A1,2)<>"12")

The no color part takes care of itself.


Gord Dibben MS Excel MVP
 
S

Shane Devenshire

Hi,

Suppose your data starts in A1 and by row you mean A1:B1, not A1:XDF1:


In 2003:
1. Select the cells you want to format
2. Choose Format, Conditional Formatting
3. Choose Formula is from the first drop down
4. In the second box enter the formula:
=AND($B1=1,LEFT($A1,2)<>"12")
5. Click the Format button
6. Choose a color on the Patterns tab (or any available option)
7. Click OK twice.

In 2007:
1. Highlight all the cells on the rows you want formatted
2. Choose Home, Conditional Formatting, 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:
=AND($B1=1,LEFT($A1,2)<>"12")
5. Click the Format button and choose a format.
6. Click OK twice
 

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