2016-08-20 33 views
0

我有这样的数据:匹配值从C返回值,其中A具有式两份(LibreOffice的计算值/ gnumeric的)

A B C 1 1 hi 2 2 hello 3 3 howdy 3 4 hi 4 5 hi there 5 6 hello there 5 7 howdy 6 8 hi

A和B包含相同的值,然而,一个有一些需要保留的副本。 B不包含A.

我要像做任何重复或任何其他值不:

“什么是下一个”

所以,我的数据会看起来像:

A C 1 hi 2 hello 3 howdy 3 howdy 5 hi there 5 hi there 6 hello there

如果是在一个没有dupliates这将是简单的,我只是有点A和B字母和删除B.然而,因为在向下移动一个额外的行中的值重复的周期性比较到B和C所以数据不再排队。 A中大约50%的值是重复的。

我试图

=if(B$2:B$6=A2,C2,error)

它的工作完美的地方有在一个没有重复前几个值(所以A - B - C的对齐),但随后后的第一个复制它只是返回错误。

+0

它看起来像你期望的结果也应该包含'4 hi'发生错误。 –

回答

0

这正是VLOOKUP所做的。

 
A B C   D 
1 1 hi   hi 
2 2 hello  hello 
3 3 howdy  howdy 
3 4 hi   howdy 
4 5 hi there hi 
5 6 hello there hi there 
5 7 howdy  hi there 
6 8 hi   hello there 
10 9 greetings #N/A 

设置公式D2=VLOOKUP(A2,B$2:C$10,2,FALSE())然后填充到D10

注:我加了第十行,以表明,当A不是B.