How can I compare a number against a list of numbers

J

johnny

In Excel 2003, I have a row of 7 numbers and wish to find if any of those
numbers is in a vertical list of 24 numbers and to highlight the numbers
which are on the vertical list.
Have tried writing a macro but have failed!
 
J

Jason Morin

Select the range of 24 numbers, go to Format >
Conditional Formatting, select "Formula Is", and put:

=COUNTIF(rng,INDIRECT("rc",0))

where "rng" is a defined name for the range of 7 numbers.

Press the Format button and format as desired.

HTH
Jason
Atlanta, GA
 
D

Duke Carey

Very nice

Jason Morin said:
Select the range of 24 numbers, go to Format >
Conditional Formatting, select "Formula Is", and put:

=COUNTIF(rng,INDIRECT("rc",0))

where "rng" is a defined name for the range of 7 numbers.

Press the Format button and format as desired.

HTH
Jason
Atlanta, GA
 
W

ww

Nice. Is there a way to do the opposite as far as highlighting the numbers
in the range of 24 that are not in the range of 7 numbers?
 
Top