Checking values in 2 columns

B

BRob

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
 
M

Mike H

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
 
R

Rick Rothstein \(MVP - VB\)

This looks like it works...

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

Rick
 
R

ryguy7272

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---
 

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