How do I update worksheet 1 from data on worksheet 2

G

Guest

I have two worksheets in same Excel file. Worksheet 1 has a record ID number
in column A and data in other columns. I have a column (lets say K) in
worksheet 1 that I want to update (replace) from worksheet 2.

Worksheet 2 doesn't have as many records as worksheet 1. Worksheet 2 also
has an record ID in column A. All IDs in WorkSheet 2 match an ID in
worksheet 1. I want to take an ID from worksheet 2, find its corresponding
ID in worksheet 1 and for that row in worksheet 1 update column K from column
B in worksheet 2 where the Worksheet 2 ID = Worksheet 1 ID.

I prefer to use an Excel functions to do it, but if I have to I would use
SQL if it is possible. Any help will be appreciated.

JR
 
G

Guest

One way..

In Sheet1,

Put in K2:
=IF(ISNA(MATCH(A2,Sheet2!A:A,0)),"",INDEX(Sheet2!B:B,MATCH(A2,Sheet2!A:A,0)))
Copy down
 
G

Guest

As you have a common "primary key" in both worksheets, you should use a
VLOOKUP formula.

Lookup_value: cell a1
Table Array: select column a to K in sheet 2
col_index_num: This is the column number of the result & works from left to
right. In this case K is the 11th column counting from A to K always
starting at 1 not zero.
Range_lookup: 0 or False (always)

Hope this helps
Denis J
 

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