Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
matching Multiple columns in Excel.
What i am trying to do is
if i have 5 columns A B C D E 25 2 3 a P 22 5 4 b 24 3 10 g A 55 8 15 k 61 9 2 p 7 0 21 d column A and B have related info. C and D HAS related info . I want to see if any entry in column C matches any entry in B, Then the corresponding row VALUE from D should be copied to a new column E in the same Row as B Eg here C1 matches B3 ( value 3) then value D1 which is value a should be copied to E3 which is same row as B3 C5 matches B1 so the value p should be copied to E 1. Any help is appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
matching Multiple columns in Excel.
The vlookup worksheet function will do what you are asking without the need
for VBA progamming. E1: =vlookup(B1,C1:D6,2,False) Note: this will bring back the first match. If you have multiple matches in column C and they might have different values in D, then vlookup is not a good solution, but there isn't enough information here to know if that occurs, and if so, what algorithm you would want to use to resolve it. "Manish" wrote: What i am trying to do is if i have 5 columns A B C D E 25 2 3 a P 22 5 4 b 24 3 10 g A 55 8 15 k 61 9 2 p 7 0 21 d column A and B have related info. C and D HAS related info . I want to see if any entry in column C matches any entry in B, Then the corresponding row VALUE from D should be copied to a new column E in the same Row as B Eg here C1 matches B3 ( value 3) then value D1 which is value a should be copied to E3 which is same row as B3 C5 matches B1 so the value p should be copied to E 1. Any help is appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
matching Multiple columns in Excel.
Hello Ker,
Thank you very much for the reply, Column B is the master Data column, Column C is the sub columns. All the data from Column C exists in B and only once. So when there is a match for any entry of C in Column B, then the corresponding value of D should be copied to a new COlumn E and use the same row as B The excel sheet i have is like this Ip-address | MAC-address | Mac-address | port address So the columns Ip address and mac -address are related and the column mac-address and port-address are related. i want to combine the 2 mac-address column into 1 master column with the correct ip address , mac-address and port address. For data that doesnt match it should give NA in the port address field. Hope this helps, Once again Thanks a lot for replying "ker_01" wrote: The vlookup worksheet function will do what you are asking without the need for VBA progamming. E1: =vlookup(B1,C1:D6,2,False) Note: this will bring back the first match. If you have multiple matches in column C and they might have different values in D, then vlookup is not a good solution, but there isn't enough information here to know if that occurs, and if so, what algorithm you would want to use to resolve it. "Manish" wrote: What i am trying to do is if i have 5 columns A B C D E 25 2 3 a P 22 5 4 b 24 3 10 g A 55 8 15 k 61 9 2 p 7 0 21 d column A and B have related info. C and D HAS related info . I want to see if any entry in column C matches any entry in B, Then the corresponding row VALUE from D should be copied to a new column E in the same Row as B Eg here C1 matches B3 ( value 3) then value D1 which is value a should be copied to E3 which is same row as B3 C5 matches B1 so the value p should be copied to E 1. Any help is appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
matching Multiple columns in Excel. | Excel Discussion (Misc queries) | |||
Matching Multiple Columns | Excel Worksheet Functions | |||
Matching multiple columns and retrieving a value | Excel Worksheet Functions | |||
Matching multiple columns | Excel Worksheet Functions | |||
Matching data in multiple columns | Excel Discussion (Misc queries) |