简体   繁体   English

Excel 在所有行中查找值,而不仅仅是第一个匹配项

[英]Excel lookup value in all rows, not just 1st match

I have the following table with columns ID and X1, and I want to obtain X2.我有下表的 ID 和 X1 列,我想获得 X2。 图片

If one row is YES in the X1 column, then in X2 column all rows with that same ID should be YES.如果 X1 列中有一行是 YES,那么在 X2 列中具有相同 ID 的所有行都应该是 YES。 Otherwise it should be NO.否则它应该是NO。 For example, ID=106629-1 (yellow) has 2 rows with NO but 1 with YES, then all three should be YES in X2 column.例如,ID=106629-1(黄色)有 2 行是 NO,但有 1 行是 YES,那么在 X2 列中这三行都应该是 YES。 The other 2 IDs (orange and blue) have all rows with NO, then X2 should be NO as well.其他 2 个 ID(橙色和蓝色)的所有行都为 NO,那么 X2 也应该为 NO。

I've tried VLOOKUP , but it only considers the 1st match.我试过VLOOKUP ,但它只考虑第一场比赛。

Use COUNTIFS to see if any are marked YES使用 COUNTIFS 查看是否有任何标记为YES

=IF(COUNTIFS(A:A,A2,B:B,"YES"),"YES","NO")

在此处输入图像描述

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

相关问题 Excel LOOKUP的前两个参数 - 1st two arguments of Excel LOOKUP Excel行(第1列)为.php文件+ Excel第1行(第2列为无穷大)作为所有文件的数据 - Excel Rows (1st column) as .php files + Excel Row 1 (2nd column to infinty) as data of all files 保留第一个单元格与其他行的第一个单元格匹配的所有行 - Keep all rows whose 1st cell matches other rows' 1st cell 在第二列中查找特定值,并使用Excel区分所有第一列 - Find a specific value in 2nd Column and distinct all its 1st column using excel 获取所有匹配值并根据另一列中值的第一次出现按顺序返回所有匹配项的公式 - Formula to get all matching values and return all occurrences of match in order based on 1st occurrence of a value in another column Excel-VBA填写第一个和最后一个值之间的单元格 - Excel - VBA fill in cells between 1st and Last value 比较2个Excel中的列,如果匹配,则将其他相应列的值从2个Excel复制到1个Excel - Compare Column in 2 excel and If matches, copy the respective other column value from 2nd excel to 1st excel Excel公式计算diff b / w第一个值和列中的最后一个值(Excel)? - Excel formula to calculate diff b/w 1st value and last value in a column (Excel)? 如何在Excel上匹配或查找值? - How can I match or lookup a value on Excel? 如果未找到匹配项,则查找 excel 返回最小值 - Lookup excel return min value if no match found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM