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?
 

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