ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How can I compare a number against a list of numbers (https://www.excelbanter.com/excel-worksheet-functions/18755-how-can-i-compare-number-against-list-numbers.html)

johnny

How can I compare a number against a list of numbers
 
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!

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

-----Original Message-----
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!
.


Duke Carey

Very nice

"Jason Morin" wrote:

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

-----Original Message-----
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!
.



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?

"Jason Morin" wrote:

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

-----Original Message-----
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!
.



Jason Morin

Thanks. You can use:

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

Jason

-----Original Message-----
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?

"Jason Morin" wrote:

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

-----Original Message-----
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!
.


.



All times are GMT +1. The time now is 11:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com