Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
matching Multiple columns in Excel. Manish Excel Discussion (Misc queries) 1 October 16th 09 09:52 PM
Matching Multiple Columns [email protected] Excel Worksheet Functions 4 October 1st 06 06:18 AM
Matching multiple columns and retrieving a value shzdug Excel Worksheet Functions 1 August 9th 06 10:45 PM
Matching multiple columns Rothman Excel Worksheet Functions 5 April 13th 06 12:39 PM
Matching data in multiple columns BuddyB Excel Discussion (Misc queries) 1 February 27th 05 08:05 PM


All times are GMT +1. The time now is 12:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"