简体   繁体   English

如何在excel中的另一列中搜索列值

[英]How to search a column value in another column in excel

I want search cell A value in cell B and arrange accordingly in cell C.我想在单元格 B 中搜索单元格 A 的值,并在单元格 C 中进行相应的排列。

How to achieve this?如何实现这一目标?

For exmaple A1= abcd xyz and B10 = abcd so B10 is exist in A1 so I want to arrange this B10 value in C1例如 A1= abcd xyz 和 B10 = abcd 所以 B10 存在于 A1 中,所以我想在 C1 中安排这个 B10 值

Try below formula.试试下面的公式。

 =IF(ISNUMBER(SEARCH(B1,A1)),B1,"")

在此处输入图片说明

You can type below formula in Cell C1 .您可以在单元格C1输入以下公式。 If B10 is found in A1, it will put B10 value in C1.如果在 A1 中找到 B10,则将 B10 值放入 C1。 Otherwise, it will put "".否则,它会放“”。

=IF(SEARCH(B10,A1) > 0,B10,"")

UPDATE : If value is not present, it will lead to #VALUE error.更新:如果值不存在,将导致 #VALUE 错误。 You can try below solution您可以尝试以下解决方案

=IFERROR(IF(SEARCH(B1,A1),B1,""),"")

@Harun24HR, has provided more cleaner solution to the problem. @Harun24HR,为该问题提供了更清洁的解决方案。

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

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