简体   繁体   English

如何使用 Excel 公式将两列值与另外两列匹配

[英]How to match two columns value with the another two columns by using Excel Formula

I am trying to match Column A and Column B data with With Column C and Column D on the same sheet.我正在尝试将 A 列和 B 列数据与同一张表上的 C 列和 D 列进行匹配。 The order of data is different and is redundant.数据的顺序不同,是多余的。 I am trying to implement the following logic.我正在尝试实现以下逻辑。

IF A11 & B11 (PAIR 1) matches (PAIR 2) in any row then copy and paste C11.如果 A11 和 B11 (PAIR 1) 与任何行中的 (PAIR 2) 匹配,则复制并粘贴 C11。

I am using this formula but it is not giving the exact output that I am looking for.我正在使用这个公式,但它没有给出我正在寻找的确切 output。

=IFERROR(IF(AND(MATCH(E11,$A$11:$A$30,0),MATCH(F11,$B$11:$B$30,0)),C11,"")," ")

I want the output to look like this.我希望 output 看起来像这样。

[![enter image description here][1]][1] [![在此处输入图片描述][1]][1]

Please check my formula where i am doing wrong?请检查我的公式哪里做错了? Please suggest me the correct formula.请建议我正确的公式。 Thanks [1]: https://i.stack.imgur.com/B9ReQ.png谢谢[1]: https://i.stack.imgur.com/B9ReQ.png

If you have O365, you can use:如果您有 O365,您可以使用:

=FILTER($C$11:$C$29,(E11=$A$11:$A$29)*(F11=$B$11:$B$29))

If you have an earlier version, try:如果您有早期版本,请尝试:

=INDEX($C$11:$C$30,AGGREGATE(15,6,1/((E11=$A$11:$A$29)*(F11=$B$11:$B$29))*ROW($A$11:$A$29),1)-10)

The 10 at the end of the formula is an adjustment for the first row (actually the first row of data -1).公式末尾的10是对第一行的调整(实际上是第一行数据-1)。 Since the data starts in Row 11, we need to subtract 10 to return the correct value.由于数据从第 11 行开始,我们需要减去 10 才能返回正确的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM