Look up information on one worksheet and transfer to another

C

Colin Hayes

Hi

In column A in worksheet 1 I have a list of numbers. Column B is blank.

In column A of worksheet 2 I have a list of numbers , with further
reference numbers next to each in column B.

What I need to do is to have a routine which will compare each number n
column A in worksheet 2 to column A in worksheet 1. It needs to run for
as many numbers as there are , and stop at the last one in the column.

Where there is a match , the number in column B in worksheet 2 needs to
be transferred to column B worksheet 1 in the same row as the matching
number. Where there is no match , the cell remains blank

example

Ws 1
A B

1
2
3
4
5
6
7
8

Ws 2
A B

1 3457
3 8566
5 2332
7 3346

After match

Ws 1
A B

1 3457
2
3 8566
4
5 2332
6
7 3346
8

I hope this seems clear.


Any help appreciated.
 
C

carlo

You could use Vlookup for this task:

in WS1 cell B1 put following formula:
=vlookup(A1,Ws2!$A$1:$B$2000,2,false)

and then drag that formula down for all rows you need.
if you want to check for errors you could use this formula:
=if(iserror(vlookup(A1,Ws2!$A$1:$B$2000,2,false)),"",vlookup(A1,Ws2!$A
$1:$A$2000,1,false))

hth

Carlo
 
C

Colin Hayes

You could use Vlookup for this task:

in WS1 cell B1 put following formula:
=vlookup(A1,Ws2!$A$1:$B$2000,2,false)

and then drag that formula down for all rows you need.
if you want to check for errors you could use this formula:
=if(iserror(vlookup(A1,Ws2!$A$1:$B$2000,2,false)),"",vlookup(A1,Ws2!$A
$1:$A$2000,1,false))

hth

Carlo

H Carlo

Yes that's got - thanks. Very helpful.


Best Wishes
 

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