简体   繁体   English

不同工作表上的四列匹配

[英]Four Columns Match on Different Worksheet

Is there a way to find if the combination of 4 column cell values has a match with a different sheet's 4 column cell and display true if the match exists using vlookup? 有没有办法找到4列单元格值的组合是否与另一个工作表的4列单元格匹配,并且如果使用vlookup存在匹配项,则显示true? If not what would be the best way to deal with this situation? 如果不是,那么应对这种情况的最佳方法是什么?

If you just want to combine the 4 columns and then have true next to them if they match in the other 4 columns you can do: 如果您只想合并4列,然后在其他4列中匹配则在其旁边有true,则可以执行以下操作:

=A2&B2&C2&D2 in the cells next to each of the 4 columns. =A2&B2&C2&D2 4列中每列旁边的单元格中的=A2&B2&C2&D2 In my example I have just had them in the first 4 columns and with a title row in the first row. 在我的示例中,我只是将它们放在前4列中,并在第一行中包含标题行。

Do that for both sets of columns. 对两组列都执行此操作。 Drag the formula down to the entire column. 将公式向下拖动到整个列。 Then next to the one you want to find a match next to do =Sheet2!E2=E2 然后在您要查找匹配项的旁边,旁边=Sheet2!E2=E2

That is assuming that the second set of 4 columns is in sheet2 with the same first 4 columns used. 假设第二组4列在sheet2中,并且使用相同的前4列。 Then it will be true or false if they exist in both. 如果两者同时存在,则为true或false。

You don't seem to need to return any value from matching rows, just check for the existence of a four column match. 您似乎不需要从匹配的行中返回任何值,只需检查是否存在四列匹配项即可。 A COUNTIFS function can accomplish this efficiently and without Helper column(s). COUNTIFS函数可以有效地完成此操作,而无需使用Helper列。 Any non-zero value can be considered True but if you need to show TRUE on the worksheet, wrap the formula in an AND function. 任何非零值都可以视为True,但是如果您需要在工作表上显示TRUE ,请将公式包装在AND函数中。

Example: You want to check columns A, B, C and D from Sheet1 with columns M, N, J and K from Sheet2. 示例:您要检查Sheet1中的A,B,C和D列以及Sheet2中的M,N,J和K列。 In an unused column to the right of the data on Sheet1, use this formula, 在Sheet1上数据右侧的未使用列中,使用以下公式,

=AND(COUNIFS(Sheet2!M:M, A2, Sheet2!N:N, B2, Sheet2!J:J, C2, Sheet2!K:K, D2))

Fill down as necessary. 根据需要填写。 Any four column matches will show TRUE ; 任何四列匹配项将显示TRUE non-matching rows will show FALSE . 不匹配的行将显示FALSE

With some absolute column references, this formula could also be used in a Conditional Formatting rule to highlight matching rows. 对于某些绝对列引用,此公式也可以用于条件格式规则中以突出显示匹配的行。

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

相关问题 如果四列匹配,则返回值 - Return value if four columns match 循环-匹配不同工作表中两列中的值,如果匹配,则将整行复制到新工作表中 - Loop - Match values in two columns in different worksheets, copy entire row to new worksheet if match 将具有特定标题的工作表列复制到另一个工作表上的不同列中 - Copy worksheet columns with particular header into a different columns on another worksheet 将此工作表中的串联列与具有多个条件的另一个工作表进行匹配 - Match concatenated columns from this worksheet to another worksheet with multiple conditions 将不同的列堆叠到不同工作表上的一列中 - Stack different columns into one column on a different worksheet 在不同的工作簿中搜索工作表; 如果找不到匹配项,则添加工作表 - Search for Worksheet in Different Workbook; Add Worksheet if No Match Found Vlookup /在不同的工作表上匹配最大最小值 - Vlookup / Match max min number on different worksheet 使用两个不同的列与另一个工作表进行比较 - Use Two Different columns to compare to another worksheet 匹配两个 Excel 工作表上的 2 列(名字和姓氏)并复制数据 - Match 2 columns (First and last names) on two excel worksheet and copy data 使用匹配多个表的匹配工作表函数来缓慢评估函数 - Evaluate function slow with Match worksheet function referencing multiple columns
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM