Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy data into another worksheet and have it update automatically? | Excel Discussion (Misc queries) | |||
Copy data into another worksheet and have it update automatically? | Excel Discussion (Misc queries) | |||
VBA: Update worksheet when txtBox data changes. | Excel Worksheet Functions | |||
VBA: Update worksheet when txtBox data changes. | Excel Worksheet Functions | |||
VBA: Update worksheet when txtBox data changes. | Excel Worksheet Functions |