View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ker_01 ker_01 is offline
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.