ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Checking values in 2 columns (https://www.excelbanter.com/excel-worksheet-functions/185783-checking-values-2-columns.html)

BRob

Checking values in 2 columns
 
I want to check a group of random integers in column A to see if there is an
equivalent value in column B (again random). I want to put the result in
column C. (eg Yes or No).

eg

A B C

1 5 Y
11 6 N
5 1 Y
5 5 Y


Can SKS help please


TIA


Rob


ps Apols if this is a double post - the first seems to have got lost
somewhere



Roger Govier[_3_]

Checking values in 2 columns
 
Hi Rob

=IF(B1="","",IF(COUNTIF(A:A,B1),"Y","N"))
Copy down as required

--
Regards
Roger Govier

"BRob" wrote in message
...
I want to check a group of random integers in column A to see if there is
an equivalent value in column B (again random). I want to put the result
in column C. (eg Yes or No).

eg

A B C

1 5 Y
11 6 N
5 1 Y
5 5 Y


Can SKS help please


TIA


Rob


ps Apols if this is a double post - the first seems to have got lost
somewhere



Mike H

Checking values in 2 columns
 
Hi,

Put this in C1 and drag down. Alter the range to suit.

=IF(ISERROR(MATCH(A1,$B$1:$B$4,0)),"N","Y")

Mike

"BRob" wrote:

I want to check a group of random integers in column A to see if there is an
equivalent value in column B (again random). I want to put the result in
column C. (eg Yes or No).

eg

A B C

1 5 Y
11 6 N
5 1 Y
5 5 Y


Can SKS help please


TIA


Rob


ps Apols if this is a double post - the first seems to have got lost
somewhere




Rick Rothstein \(MVP - VB\)[_362_]

Checking values in 2 columns
 
This looks like it works...

=MID("NY",1+ISNUMBER(MATCH(A1,B:B,0)),1)

Rick


"BRob" wrote in message
...
I want to check a group of random integers in column A to see if there is
an equivalent value in column B (again random). I want to put the result in
column C. (eg Yes or No).

eg

A B C

1 5 Y
11 6 N
5 1 Y
5 5 Y


Can SKS help please


TIA


Rob


ps Apols if this is a double post - the first seems to have got lost
somewhere




ryguy7272

Checking values in 2 columns
 
This macro will do what you want:
Sub Different()
Dim i As Integer

For i = 2 To 50
If Worksheets("Check Number in Column").Cells(i, 1) = Worksheets("Check
Number in Column").Cells(i, 2) Then
Worksheets("Check Number in Column").Cells(i, 3) = ""
Else
Worksheets("Check Number in Column").Cells(i, 3) = "Different"
End If
Next i
End Sub

Make sure your sheet is named appropriately...

Regards,
Ryan---

--
RyGuy


"Rick Rothstein (MVP - VB)" wrote:

This looks like it works...

=MID("NY",1+ISNUMBER(MATCH(A1,B:B,0)),1)

Rick


"BRob" wrote in message
...
I want to check a group of random integers in column A to see if there is
an equivalent value in column B (again random). I want to put the result in
column C. (eg Yes or No).

eg

A B C

1 5 Y
11 6 N
5 1 Y
5 5 Y


Can SKS help please


TIA


Rob


ps Apols if this is a double post - the first seems to have got lost
somewhere






All times are GMT +1. The time now is 04:41 PM.

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