ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   comparing a number in a cell against multiple numbers in the same (https://www.excelbanter.com/excel-discussion-misc-queries/184097-comparing-number-cell-against-multiple-numbers-same.html)

mpenkala

comparing a number in a cell against multiple numbers in the same
 
Hey again gang,
should be an easy one.

In cell A16 I have the number 27
In cell U15 I have 23,35,4,16 (written just like this).

What I'm looking for is in cell V15 to determine whether the number in A16
(27) is a match to any of the numbers in u15 (23,35,4,16) - this time it
isn't.

If it is, then I would like to get a "Match", if not "No Match"

Thanks!
Matt


bpeltzer

comparing a number in a cell against multiple numbers in the same
 
Here's my first thought:
=IF(ISERROR(FIND(" " & A16 & " "," " & SUBSTITUTE(U15,","," , ") & " ")),"no
match","match")

I'm putting each number between a couple of space characters then looking
for a match. That avoids the potential of matching a couple of digits (eg
finding "23" as part of "423"). Then if the 'find' returns an error, then
I've got 'no match'.


"mpenkala" wrote:

Hey again gang,
should be an easy one.

In cell A16 I have the number 27
In cell U15 I have 23,35,4,16 (written just like this).

What I'm looking for is in cell V15 to determine whether the number in A16
(27) is a match to any of the numbers in u15 (23,35,4,16) - this time it
isn't.

If it is, then I would like to get a "Match", if not "No Match"

Thanks!
Matt


mpenkala

comparing a number in a cell against multiple numbers in the s
 
excellent, works like a charm.

Appriciate the help!
Matt


"bpeltzer" wrote:

Here's my first thought:
=IF(ISERROR(FIND(" " & A16 & " "," " & SUBSTITUTE(U15,","," , ") & " ")),"no
match","match")

I'm putting each number between a couple of space characters then looking
for a match. That avoids the potential of matching a couple of digits (eg
finding "23" as part of "423"). Then if the 'find' returns an error, then
I've got 'no match'.


"mpenkala" wrote:

Hey again gang,
should be an easy one.

In cell A16 I have the number 27
In cell U15 I have 23,35,4,16 (written just like this).

What I'm looking for is in cell V15 to determine whether the number in A16
(27) is a match to any of the numbers in u15 (23,35,4,16) - this time it
isn't.

If it is, then I would like to get a "Match", if not "No Match"

Thanks!
Matt


T. Valko

comparing a number in a cell against multiple numbers in the same
 
Another one:

=IF(COUNT(FIND(","&A16&",",","&U15&",")),"Match"," No Match")

--
Biff
Microsoft Excel MVP


"mpenkala" wrote in message
...
Hey again gang,
should be an easy one.

In cell A16 I have the number 27
In cell U15 I have 23,35,4,16 (written just like this).

What I'm looking for is in cell V15 to determine whether the number in A16
(27) is a match to any of the numbers in u15 (23,35,4,16) - this time it
isn't.

If it is, then I would like to get a "Match", if not "No Match"

Thanks!
Matt





All times are GMT +1. The time now is 06:44 AM.

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