Excel 查找以在两列中查找值

Excel 查找以在两列中查找值,excel,excel-formula,Excel,Excel Formula,我有两张床单。表1中有此数据 Name red blue John x John x John x John x John x Name red blue John 第2页有这些数据 Name red blue John x John x John x John x John x Name red blue John

我有两张床单。表1中有此数据

Name    red blue
John    x   
John    x   
John        x
John    x   
John    x   
Name    red blue
John        
第2页有这些数据

Name    red blue
John    x   
John    x   
John        x
John    x   
John    x   
Name    red blue
John        
我需要一个公式来填充红色和蓝色列下的“x”,因为Sheet1中的数据在红色和蓝色列中至少有一个“x”。我尝试使用vlookup/hlookup,但它返回第一个值。indexmatch也一样。

这个怎么样

IF(COUNTIF(range,"x"),"x","")
范围将是您的列,例如:B2:B99

这个怎么样

IF(COUNTIF(range,"x"),"x","")
范围将是您的列,例如:B2:B99

=IF(COUNTIFS(Sheet1!$A:$A,$E2,Sheet1!B:B,"x"),"x","")
使用countif:

=IF(COUNTIFS(Sheet1!$A:$A,$E2,Sheet1!B:B,"x"),"x","")

你尝试了什么配方,把它放在哪里?你尝试了什么配方,把它放在哪里?