![]() |
How do I update worksheet 1 from data on worksheet 2
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 |
How do I update worksheet 1 from data on worksheet 2
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 -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "JR" wrote: 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 |
How do I update worksheet 1 from data on worksheet 2
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 "JR" wrote: 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 |
All times are GMT +1. The time now is 09:49 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com