0

如何检查两个工作表之间的相同文本。然后,当我找到匹配项时,我想粘贴与给定文本相对应的特定列范围。例如:

worksheet 1
column N has values
e
e
a
b
e
c
d


worksheet 2
col A     col B     col C     col D
a         0.1       0.1       0.1
b         0.3       0.5       0.3
c         0.3       0.1       0.4
d         0.3       0.2       0.5
e         0.5       0.6       0.9

这样,工作表 2 就是参考。我们想过滤工作表 1 中的 N 列与工作表 2 的 A 列。如果我们找到匹配项,我们希望从 B、C、D 列中获取相应的值,并将它们放入 N 列之后的工作表 1(比如 O、P 列,问)。

我怎么能用公式或 VB 宏来做到这一点?

4

2 回答 2

0

U sing Formula Vlookup you can do it as follow :

assuming you have value in N column i,e. a,b,c,d etc. in sheet1 and refrence values in range of column A to E whiles A containing refrence value i.e. a,b,c,c etc. in sheet 2

Enter the following code in Sheet 1 in mentinoed cell and drag it down the rows in sheet 1

=VLOOKUP(N1,Sheet2!$A$1:$E$3,2,FALSE) in O1 cell
=VLOOKUP(N1,Sheet2!$A$1:$E$3,3,FALSE) in P1 Cell
=VLOOKUP(N1,Sheet2!$A$1:$E$3,4,FALSE) in Q1 cell 

note: you will need to modify the range in Vlookup as per the length of you reference data currently it will cover only first three row $A$1:$E$3 and 4 column.

于 2013-06-04T09:59:04.707 回答
0

在工作表 2(比如数组)中命名 A:D 并=VLOOKUP($N2,array,COLUMN()-13,FALSE)O2工作表 1 中应用(假设顶部e在 中N2)并根据需要向下和向下复制。

于 2013-06-03T14:14:44.677 回答