Can Conditional Formatting do this?

T

Tmaxx02

I have numbers in rows d3 through f22:

D3 E3 F3
9 1 6
1 9 0

etc.

In d26 and E26 I have to cell that I can input numbers into:

1 9


I would like to highlight the cells with only thoses numbers, in this
case 1, and 9, but not the 6 or the 0. In other words, I want to
highlight only the cells in the row that I have inputted, and only if
the row contains both numbers.

Thanks, Terry
 
M

Max

Select D3:F4 (D3 active),
apply CF using Formula is:
=COUNTIF($D$26:$E$26,D3)
Format to taste, ok out
 
K

Ken Johnson

I have numbers in rows d3 through f22:

D3 E3 F3
9 1 6
1 9 0

etc.

In d26 and E26 I have to cell that I can input numbers into:

1 9

I would like to highlight the cells with only thoses numbers, in this
case 1, and 9, but not the 6 or the 0. In other words, I want to
highlight only the cells in the row that I have inputted, and only if
the row contains both numbers.

Thanks, Terry

Select D3:F22 then, in the "Formula Is" part of the conditional
formatting dialogue try...

=AND(COUNTIF($D3:$F3,$D$26)+COUNTIF($D3:$F3,$E$26)>1,OR(D3=$D$26,D3=$E
$26))

This works but there could very well be a simpler formula that
highlights the cells containing the inputted values in rows that have
both values.

Ken Johnson
 
K

Ken Johnson

Thanks, but both of these suggestions highlight the entire selected
range.

You must be doing something different to what I'm doing because on my
sheet only the 9 and 1 is highlighted, the 6 and 0 are left alone.
Also, on my sheet there is no highlighting on rows with the 9 but not
the 1 or the 1 but not the 9.

Did you first select the range D3:F22 then paste the formula into the
"Formula Is" part of the cond format dialog?
If you didn't paste the formula did you ensure that what you typed was
exactly the same as my posted formula, $ signs and lack of $ signs are
extremely important.

Ken Johnson
 
M

Max

Think I missed this spec earlier
... and only if the row contains both numbers

Try this revised CF formula ..

Select D3:F22 (D3 active),
apply CF using Formula is:
=AND(COUNTIF($D$26:$E$26,D3)>0,SUMPRODUCT(--(ISNUMBER(MATCH($D$26:$E$26,$D3:$F3,0))))>=2)
Format to taste, ok out
 
T

Tmaxx02

Thank you, the last formula worked beautifully, exactly what I wanted.
I'm also going to go back and re-check out the previous suggestions to
see if I did it wrong. Again, I'm grateful for all the help.

Terry
 
T

Tmaxx02

I owe the other guys a huge apology. I went back and redid the
previous formula, and did it wrong a few more times, and then I
finally typed it correctly and it too worked. I'm sorry for the mix
up, but you guys are the greatest, and I deeply appreciate the help.

Terry
 
M

Max

Glad you got it working
Thanks for feeding back

---
I owe the other guys a huge apology. I went back and redid the
previous formula, and did it wrong a few more times, and then I
finally typed it correctly and it too worked. I'm sorry for the mix
up, but you guys are the greatest, and I deeply appreciate the help.

Terry
 

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

Excel Conditional Formatting 1
Conditional Format 1
Supress DIV/0 2
Excel formula for inventory problem 2
conditional formula needed 2
Conditional Formatting using Small 1
Conditional Formatting 3
Conditional formating 1

Top