简体   繁体   English

检查多个工作表中是否存在值

[英]Check if value exists in multiple sheets

I have one excel with the following sheets 我有以下表格的一个excel

MAY
JUNE
JULY
AUGUST

Inside each sheet i have one column (A) with around 200 rows and in each cell I have a 6 digit number. 在每张纸内,我有一列(A),大约200行,每个单元格中有一个6位数字。

I would like to somehow in column (B) next to each number to check all sheets and if the number exists to return any text value for example "OK". 我想以某种方式在每个数字旁边的列(B)中检查所有表格,如果存在该数字则返回任何文本值,例如“OK”。

So if I write the number "000000" in Sheet JULY, Column A, line 67 and this number exists in Sheet MAY, Column A, line 120, I would like to see the word "OK" in Sheet JULY, Column B, line 67 因此,如果我在Sheet JULY,A列,第67行写下数字“000000”,并且这个数字存在于Sheet MAY,A列,第120行,我希望在Sheet JULY,B列,行中看到单词“OK” 67

What I have tried so far is: 到目前为止我尝试过的是:

=IFERROR(IF(MATCH(A2,MAY!$A:$A,0),"YES",),"NO")

But this one only checks one Sheet (MAY) I would like to have the option to check two or more Sheets. 但是这个只检查一张(MAY)我想选择检查两张或更多张。

Thanks 谢谢

You're almost there. 你快到了。 The formula you want is: 你想要的公式是:

=IF(SUM(If(IFERROR(MATCH(A2,MAY!$A:$A,0),0)=0,0,1),If(IFERROR(MATCH(A2,JUNE!$A:$A,0),0)=0,0,1),…)<4,"No","Yes")

Please complete the formula with the others sheets you need or adjust it to your case. 请使用您需要的其他表格填写公式或根据您的情况进行调整。

Note that MATCH function will return a non null value is it finds a match. 请注意, MATCH函数将在找到匹配项时返回非null值。 The Error catch IFERROR returns 0 . Error catch IFERROR返回0 So, if the any of the MATCH s fails, the SUM returns a number less than 4 . 因此,如果任何MATCH失败,则SUM返回小于4的数字。

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

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